Module: IfElse::FalseIfBehavior

Included in:
FalseClass, NilClass
Defined in:
lib/ifelse.rb

Instance Method Summary collapse

Instance Method Details

#ifObject

[View source]

17
18
19
20
# File 'lib/ifelse.rb', line 17

def if
  raise "Syntax Error: if without block" unless block_given?
  self
end

#unless {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

[View source]

22
23
24
25
# File 'lib/ifelse.rb', line 22

def unless
  raise "Syntax Error: unless without block" unless block_given?
  yield self
end