Class: Ruby::Case

Inherits:
NamedAggregate show all
Defined in:
lib/ruby/case.rb

Instance Attribute Summary

Attributes included from Node::Composite

#parent

Instance Method Summary collapse

Methods inherited from Aggregate

#position, #position=, #prolog, #prolog=, #to_ruby

Methods inherited from Node

#<=>, #all_nodes, #column, #length, #row

Methods included from Conversions

included, #to_node

Methods included from Node::Traversal

#has_token?, #has_type?, #has_value?, #is_instance_of?, #left_of?, #matches?, #position?, #right_of?, #select

Methods included from Node::Source

#context, #filename, #line, #lines, #src

Methods included from Node::Composite

included, #root, #root?

Constructor Details

#initialize(identifier, expression, block, rdelim) ⇒ Case

Returns a new instance of Case.



7
8
9
10
11
# File 'lib/ruby/case.rb', line 7

def initialize(identifier, expression, block, rdelim)
  self.expression = expression
  self.block = block
  super(identifier, nil, rdelim)
end

Instance Method Details

#nodesObject



13
14
15
# File 'lib/ruby/case.rb', line 13

def nodes
  [identifier, expression, block, rdelim].compact
end