Class: Glaemscribe::API::IfTree::IfCond
Overview
A branching if condition
Instance Attribute Summary collapse
-
#child_code_block ⇒ Object
Returns the value of attribute child_code_block.
-
#expression ⇒ Object
Returns the value of attribute expression.
-
#line ⇒ Object
Returns the value of attribute line.
-
#parent_if_term ⇒ Object
Returns the value of attribute parent_if_term.
Instance Method Summary collapse
-
#initialize(line, parent_if_term, expression) ⇒ IfCond
constructor
A new instance of IfCond.
- #inspect ⇒ Object
- #offset ⇒ Object
- #prefix ⇒ Object
Constructor Details
#initialize(line, parent_if_term, expression) ⇒ IfCond
Returns a new instance of IfCond.
30 31 32 33 |
# File 'lib/api/if_tree.rb', line 30 def initialize(line, parent_if_term, expression) @parent_if_term = parent_if_term @expression = expression end |
Instance Attribute Details
#child_code_block ⇒ Object
Returns the value of attribute child_code_block.
29 30 31 |
# File 'lib/api/if_tree.rb', line 29 def child_code_block @child_code_block end |
#expression ⇒ Object
Returns the value of attribute expression.
29 30 31 |
# File 'lib/api/if_tree.rb', line 29 def expression @expression end |
#line ⇒ Object
Returns the value of attribute line.
29 30 31 |
# File 'lib/api/if_tree.rb', line 29 def line @line end |
#parent_if_term ⇒ Object
Returns the value of attribute parent_if_term.
29 30 31 |
# File 'lib/api/if_tree.rb', line 29 def parent_if_term @parent_if_term end |
Instance Method Details
#inspect ⇒ Object
40 41 42 43 |
# File 'lib/api/if_tree.rb', line 40 def inspect "#{prefix} IF #{expression}\n" + "#{child_code_block.inspect}" end |
#offset ⇒ Object
34 35 36 |
# File 'lib/api/if_tree.rb', line 34 def offset parent_if_term.offset + " " end |
#prefix ⇒ Object
37 38 39 |
# File 'lib/api/if_tree.rb', line 37 def prefix offset + "|-" end |