Class: Melbourne::AST::Define
- Inherits:
-
ClosedScope
- Object
- Node
- ClosedScope
- Melbourne::AST::Define
- Defined in:
- lib/melbourne/ast/definitions.rb
Overview
A method definition as in:
def method
end
Direct Known Subclasses
Instance Attribute Summary collapse
-
#arguments ⇒ Object
The arguments of the defined method.
-
#name ⇒ Object
The name of the defined method.
Attributes inherited from ClosedScope
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, name, block) ⇒ Define
constructor
A new instance of Define.
Methods inherited from Node
Constructor Details
#initialize(line, name, block) ⇒ Define
Returns a new instance of Define.
104 105 106 107 108 109 110 |
# File 'lib/melbourne/ast/definitions.rb', line 104 def initialize(line, name, block) @line = line @name = name @arguments = block.strip_arguments block.array << Nil.new(line) if block.array.empty? @body = block end |
Instance Attribute Details
#arguments ⇒ Object
The arguments of the defined method
102 103 104 |
# File 'lib/melbourne/ast/definitions.rb', line 102 def arguments @arguments end |
#name ⇒ Object
The name of the defined method
98 99 100 |
# File 'lib/melbourne/ast/definitions.rb', line 98 def name @name end |