Class: Kumi::Core::NAST::Declaration
- Defined in:
- lib/kumi/core/nast.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(name:, body:, **k) ⇒ Declaration
constructor
A new instance of Declaration.
- #kind ⇒ Object
Constructor Details
#initialize(name:, body:, **k) ⇒ Declaration
Returns a new instance of Declaration.
210 211 212 213 214 |
# File 'lib/kumi/core/nast.rb', line 210 def initialize(name:, body:, **k) super(**k) @name = name.to_sym @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
208 209 210 |
# File 'lib/kumi/core/nast.rb', line 208 def body @body end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
208 209 210 |
# File 'lib/kumi/core/nast.rb', line 208 def name @name end |
Instance Method Details
#accept(visitor) ⇒ Object
216 217 218 |
# File 'lib/kumi/core/nast.rb', line 216 def accept(visitor) visitor.visit_declaration(self) end |
#kind ⇒ Object
220 221 222 |
# File 'lib/kumi/core/nast.rb', line 220 def kind [:kind] end |