Class: Rubinius::AST::ReceiverCase

Inherits:
Case
  • Object
show all
Defined in:
lib/compiler/ast/control_flow.rb

Instance Attribute Summary collapse

Attributes inherited from Case

#else, #whens

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Case

#to_sexp

Methods inherited from Node

#ascii_graph, #attributes, #children, match_arguments?, match_send?, #new_block_generator, #new_generator, #node_name, node_name, #pos, #set_child, #to_sexp, #transform, transform, transform_comment, transform_kind, transform_kind=, transform_name, #visit, #walk

Constructor Details

#initialize(line, receiver, whens, else_body) ⇒ ReceiverCase

Returns a new instance of ReceiverCase.



30
31
32
33
34
35
# File 'lib/compiler/ast/control_flow.rb', line 30

def initialize(line, receiver, whens, else_body)
  @line = line
  @receiver = receiver
  @whens = whens
  @else = else_body || NilLiteral.new(line)
end

Instance Attribute Details

#receiverObject

Returns the value of attribute receiver.



28
29
30
# File 'lib/compiler/ast/control_flow.rb', line 28

def receiver
  @receiver
end

Instance Method Details

#receiver_sexpObject



37
38
39
# File 'lib/compiler/ast/control_flow.rb', line 37

def receiver_sexp
  @receiver.to_sexp
end