class Iolite::Statement::IfThenElse

Public Class Methods

new(cond, then_) click to toggle source
# File lib/iolite/statement/if.rb, line 7
def initialize cond, then_
        @cond = cond
        @then_ = then_
end

Public Instance Methods

[](*else_) click to toggle source
# 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