Class: Kumi::Core::NAST::Select
- Defined in:
- lib/kumi/core/nast.rb
Overview
Control: ternary select (pure, eager)
Instance Attribute Summary collapse
-
#cond ⇒ Object
readonly
Returns the value of attribute cond.
-
#on_false ⇒ Object
readonly
Returns the value of attribute on_false.
-
#on_true ⇒ Object
readonly
Returns the value of attribute on_true.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #children ⇒ Object
-
#initialize(cond:, on_true:, on_false:, **k) ⇒ Select
constructor
A new instance of Select.
Methods inherited from Node
Constructor Details
#initialize(cond:, on_true:, on_false:, **k) ⇒ Select
Returns a new instance of Select.
178 179 180 181 182 183 |
# File 'lib/kumi/core/nast.rb', line 178 def initialize(cond:, on_true:, on_false:, **k) super(**k) @cond = cond @on_true = on_true @on_false = on_false end |
Instance Attribute Details
#cond ⇒ Object (readonly)
Returns the value of attribute cond.
176 177 178 |
# File 'lib/kumi/core/nast.rb', line 176 def cond @cond end |
#on_false ⇒ Object (readonly)
Returns the value of attribute on_false.
176 177 178 |
# File 'lib/kumi/core/nast.rb', line 176 def on_false @on_false end |
#on_true ⇒ Object (readonly)
Returns the value of attribute on_true.
176 177 178 |
# File 'lib/kumi/core/nast.rb', line 176 def on_true @on_true end |
Instance Method Details
#accept(visitor) ⇒ Object
185 186 187 |
# File 'lib/kumi/core/nast.rb', line 185 def accept(visitor) visitor.respond_to?(:visit_select) ? visitor.visit_select(self) : super end |
#children ⇒ Object
189 |
# File 'lib/kumi/core/nast.rb', line 189 def children = [cond, on_true, on_false] |