Class: Estreet::VariableDeclaration
- Defined in:
- lib/estreet/variable_declaration.rb
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
- #attributes ⇒ Object
-
#initialize(declarations) ⇒ VariableDeclaration
constructor
A new instance of VariableDeclaration.
- #to_declaration ⇒ Object
Methods inherited from Statement
Methods inherited from Node
Constructor Details
#initialize(declarations) ⇒ VariableDeclaration
Returns a new instance of VariableDeclaration.
3 4 5 6 7 |
# File 'lib/estreet/variable_declaration.rb', line 3 def initialize(declarations) raise TypeError unless declarations.all? {|d| d.is_a? VariableDeclarator} @declarations = declarations end |
Instance Method Details
#attributes ⇒ Object
9 10 11 |
# File 'lib/estreet/variable_declaration.rb', line 9 def attributes super.merge(declarations: @declarations, kind: "var".freeze) end |
#to_declaration ⇒ Object
13 14 15 |
# File 'lib/estreet/variable_declaration.rb', line 13 def to_declaration self end |