Class: Melbourne::AST::Yield
- Inherits:
-
SendWithArguments
- Object
- Node
- Send
- SendWithArguments
- Melbourne::AST::Yield
- Defined in:
- lib/melbourne/ast/sends.rb
Overview
A yield statement as in:
def method(&block)
yield 1
end
Instance Attribute Summary collapse
-
#flags ⇒ Object
TODO: document!.
Attributes inherited from SendWithArguments
Attributes inherited from Send
#block, #check_for_local, #name, #privately, #receiver, #variable
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(line, arguments, unwrap) ⇒ Yield
constructor
A new instance of Yield.
Methods inherited from Node
Constructor Details
#initialize(line, arguments, unwrap) ⇒ Yield
Returns a new instance of Yield.
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 |
# File 'lib/melbourne/ast/sends.rb', line 416 def initialize(line, arguments, unwrap) @line = line if arguments.kind_of? ArrayLiteral and not unwrap arguments = ArrayLiteral.new line, [arguments] end @arguments = ActualArguments.new line, arguments @argument_count = @arguments.size @yield_splat = false if @arguments.splat? splat = @arguments.splat.value if (splat.kind_of? ArrayLiteral or splat.kind_of? EmptyArray) and not unwrap @argument_count += 1 else @yield_splat = true end end end |
Instance Attribute Details
#flags ⇒ Object
TODO: document!
414 415 416 |
# File 'lib/melbourne/ast/sends.rb', line 414 def flags @flags end |