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
-
#initialize(cond:, on_true:, on_false:, **k) ⇒ Select
constructor
A new instance of Select.
Constructor Details
#initialize(cond:, on_true:, on_false:, **k) ⇒ Select
Returns a new instance of Select.
164 165 166 167 168 169 |
# File 'lib/kumi/core/nast.rb', line 164 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.
162 163 164 |
# File 'lib/kumi/core/nast.rb', line 162 def cond @cond end |
#on_false ⇒ Object (readonly)
Returns the value of attribute on_false.
162 163 164 |
# File 'lib/kumi/core/nast.rb', line 162 def on_false @on_false end |
#on_true ⇒ Object (readonly)
Returns the value of attribute on_true.
162 163 164 |
# File 'lib/kumi/core/nast.rb', line 162 def on_true @on_true end |
Instance Method Details
#accept(visitor) ⇒ Object
171 172 173 |
# File 'lib/kumi/core/nast.rb', line 171 def accept(visitor) visitor.respond_to?(:visit_select) ? visitor.visit_select(self) : super end |