Module: Iolite::Statement

Included in:
Iolite
Defined in:
lib/iolite/statement/if.rb,
lib/iolite/statement/if_else.rb

Defined Under Namespace

Classes: If, IfThenElse

Class Method Summary collapse

Class Method Details

.if_(cond) ⇒ Object



44
45
46
# File 'lib/iolite/statement/if.rb', line 44

def if_ cond
	If.new cond
end

.if_else(cond, then_, else_) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/iolite/statement/if_else.rb', line 2

def if_else cond, then_, else_
	Lazy.new { |*args|
		if Functinal.invoke(cond, *args)
			Functinal.invoke(then_, *args)
		else
			Functinal.invoke(else_, *args)
		end
	}
end