Class: Iolite::Statement::IfThenElse
- Defined in:
- lib/iolite/statement/if.rb
Instance Method Summary collapse
- #[](*else_) ⇒ Object
-
#initialize(cond, then_) ⇒ IfThenElse
constructor
A new instance of IfThenElse.
Constructor Details
#initialize(cond, then_) ⇒ IfThenElse
7 8 9 10 |
# File 'lib/iolite/statement/if.rb', line 7 def initialize cond, then_ @cond = cond @then_ = then_ end |
Instance Method Details
#[](*else_) ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/iolite/statement/if.rb', line 12 def [](*else_) Iolite.lazy { |*args| if Iolite::Functinal.invoke(@cond, *args) Iolite::Functinal.invoke_a(@then_, *args).last else Iolite::Functinal.invoke_a(else_, *args).last end } end |