Class: IV::Phonic::AST::Property
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(parent, prop) ⇒ Property
constructor
A new instance of Property.
Methods inherited from Node
#begin_position, #end_position, #program, #source
Constructor Details
#initialize(parent, prop) ⇒ Property
Returns a new instance of Property.
440 441 442 443 444 |
# File 'lib/iv/phonic/ast.rb', line 440 def initialize parent, prop super parent, prop @key = Identifier.new self, prop[:key] @value = Expression.as self, prop[:value] end |
Class Method Details
.as(parent, expr) ⇒ Object
437 438 439 |
# File 'lib/iv/phonic/ast.rb', line 437 def self.as parent, expr return PropertyType2Class[expr[:kind]].new parent, expr end |