Class: Hokusai::Ast::Prop

Inherits:
Object
  • Object
show all
Defined in:
ui/src/hokusai/ast.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Prop

Returns a new instance of Prop.



99
100
101
# File 'ui/src/hokusai/ast.rb', line 99

def initialize(raw)
  @raw = raw
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



97
98
99
# File 'ui/src/hokusai/ast.rb', line 97

def raw
  @raw
end

Instance Method Details

#computed?Boolean

Returns:

  • (Boolean)


103
104
105
# File 'ui/src/hokusai/ast.rb', line 103

def computed?
  raw[:computed]
end

#nameObject



107
108
109
# File 'ui/src/hokusai/ast.rb', line 107

def name
  @name ||= raw[:name].freeze
end

#valueObject



111
112
113
114
115
116
117
# File 'ui/src/hokusai/ast.rb', line 111

def value
  @call ||= raw[:call]

  return nil if @call.null?

  @func ||= Func.new(@call)
end