Class: Johnson::Nodes::TernaryNode

Inherits:
Node
  • Object
show all
Defined in:
lib/johnson/nodes/ternary_node.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#column, #line, #value

Instance Method Summary collapse

Methods inherited from Node

#each, #to_dot, #to_ecma, #to_s, #to_sexp

Methods included from Visitable

#accept

Constructor Details

#initialize(line, column, cond, b_then, b_else) ⇒ TernaryNode

Returns a new instance of TernaryNode.



12
13
14
15
16
# File 'lib/johnson/nodes/ternary_node.rb', line 12

def initialize(line, column, cond, b_then, b_else)
  super(line, column, b_else)
  @cond   = cond
  @b_then = b_then
end

Instance Attribute Details

#b_thenObject

Returns the value of attribute b_then.



11
12
13
# File 'lib/johnson/nodes/ternary_node.rb', line 11

def b_then
  @b_then
end

#condObject

Returns the value of attribute cond.



11
12
13
# File 'lib/johnson/nodes/ternary_node.rb', line 11

def cond
  @cond
end