Class: Melbourne::AST::DefaultArguments
- Defined in:
- lib/melbourne/ast/definitions.rb
Overview
Defaults arguments of a method. This of node also contains the actual statements that define the defaults.
Instance Attribute Summary collapse
-
#arguments ⇒ Object
The statements that define the defaults (these are usually Melbourne::AST::LocalVariableAssignment nodes).
-
#names ⇒ Object
The names of the arguments.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, block) ⇒ DefaultArguments
constructor
A new instance of DefaultArguments.
Methods inherited from Node
Constructor Details
#initialize(line, block) ⇒ DefaultArguments
258 259 260 261 262 263 |
# File 'lib/melbourne/ast/definitions.rb', line 258 def initialize(line, block) @line = line array = block.array @names = array.map { |a| a.name } @arguments = array end |
Instance Attribute Details
#arguments ⇒ Object
The statements that define the defaults (these are usually Melbourne::AST::LocalVariableAssignment nodes)
252 253 254 |
# File 'lib/melbourne/ast/definitions.rb', line 252 def arguments @arguments end |
#names ⇒ Object
The names of the arguments
256 257 258 |
# File 'lib/melbourne/ast/definitions.rb', line 256 def names @names end |