class CodeTools::AST::SendWithArguments

Attributes

arguments[RW]

Public Class Methods

new(line, receiver, name, arguments, privately=false) click to toggle source
Calls superclass method CodeTools::AST::Send::new
# File lib/rubinius/code/ast/sends.rb, line 151
def initialize(line, receiver, name, arguments, privately=false)
  super line, receiver, name, privately
  @block = nil
  @arguments = Arguments.new line, arguments
end

Public Instance Methods

arguments_sexp(name=:arglist) click to toggle source
# File lib/rubinius/code/ast/sends.rb, line 174
def arguments_sexp(name=:arglist)
  sexp = [name]

  case @arguments
  when PushArguments
    sexp << @arguments.to_sexp
  else
    sexp += @arguments.to_sexp
  end

  sexp << @block.to_sexp if @block
  sexp
end
bytecode(g, anddot=false) click to toggle source
# File lib/rubinius/code/ast/sends.rb, line 157
def bytecode(g, anddot=false)
  @receiver.bytecode(g) unless anddot
  @arguments.bytecode(g)

  pos(g)

  if @arguments.splat?
    @block ? @block.bytecode(g) : g.push_tagged_nil(0)
    g.send_with_splat @name, @arguments.size, @privately, false
  elsif @block
    @block.bytecode(g)
    g.send_with_block @name, @arguments.size, @privately
  else
    g.send @name, @arguments.size, @privately
  end
end