Class: RBelly::Nodes::IfNode

Inherits:
Node
  • Object
show all
Defined in:
lib/rbelly/nodes/if_node.rb

Direct Known Subclasses

ConditionalNode

Instance Attribute Summary collapse

Attributes inherited from Node

#comments, #filename, #line, #value

Instance Method Summary collapse

Methods inherited from Node

#==, #===, #each, #pointcut, #to_dots, #to_ecma, #to_real_sexp, #to_sexp

Methods included from Visitable

#accept

Constructor Details

#initialize(conditions, value, else_stmt = nil) ⇒ IfNode

Returns a new instance of IfNode.



5
6
7
8
9
# File 'lib/rbelly/nodes/if_node.rb', line 5

def initialize(conditions, value, else_stmt = nil)
  super(value)
  @conditions = conditions
  @else = else_stmt
end

Instance Attribute Details

#conditionsObject (readonly)

Returns the value of attribute conditions.



4
5
6
# File 'lib/rbelly/nodes/if_node.rb', line 4

def conditions
  @conditions
end

#elseObject (readonly)

Returns the value of attribute else.



4
5
6
# File 'lib/rbelly/nodes/if_node.rb', line 4

def else
  @else
end