Class: Melbourne::AST::DefaultArguments

Inherits:
Node
  • Object
show all
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

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

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

#argumentsObject

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

#namesObject

The names of the arguments



256
257
258
# File 'lib/melbourne/ast/definitions.rb', line 256

def names
  @names
end