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
- #children ⇒ Object
-
#initialize(name:, body:, **k) ⇒ Declaration
constructor
A new instance of Declaration.
- #kind ⇒ Object
Methods inherited from Node
Constructor Details
#initialize(name:, body:, **k) ⇒ Declaration
Returns a new instance of Declaration.
230 231 232 233 234 |
# File 'lib/kumi/core/nast.rb', line 230 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.
228 229 230 |
# File 'lib/kumi/core/nast.rb', line 228 def body @body end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
228 229 230 |
# File 'lib/kumi/core/nast.rb', line 228 def name @name end |
Instance Method Details
#accept(visitor) ⇒ Object
236 237 238 |
# File 'lib/kumi/core/nast.rb', line 236 def accept(visitor) visitor.visit_declaration(self) end |
#children ⇒ Object
240 |
# File 'lib/kumi/core/nast.rb', line 240 def children = [body] |
#kind ⇒ Object
242 243 244 |
# File 'lib/kumi/core/nast.rb', line 242 def kind [:kind] end |