Class: Rubinius::AST::DefaultArguments
- Defined in:
- lib/compiler/ast/definitions.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#names ⇒ Object
Returns the value of attribute names.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, block) ⇒ DefaultArguments
constructor
A new instance of DefaultArguments.
- #map_arguments(scope) ⇒ Object
- #to_sexp ⇒ Object
Methods inherited from Node
#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, transform, #transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk
Constructor Details
#initialize(line, block) ⇒ DefaultArguments
Returns a new instance of DefaultArguments.
407 408 409 410 411 412 |
# File 'lib/compiler/ast/definitions.rb', line 407 def initialize(line, block) @line = line array = block.array @names = array.map { |a| a.name } @arguments = array end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
405 406 407 |
# File 'lib/compiler/ast/definitions.rb', line 405 def arguments @arguments end |
#names ⇒ Object
Returns the value of attribute names.
405 406 407 |
# File 'lib/compiler/ast/definitions.rb', line 405 def names @names end |
Instance Method Details
#map_arguments(scope) ⇒ Object
414 415 416 |
# File 'lib/compiler/ast/definitions.rb', line 414 def map_arguments(scope) @arguments.each { |var| scope.assign_local_reference var } end |
#to_sexp ⇒ Object
418 419 420 |
# File 'lib/compiler/ast/definitions.rb', line 418 def to_sexp @arguments.map { |x| x.to_sexp } end |