Method: Object#or_then

Defined in:
lib/mug/and-or.rb

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

Calls block is obj is not falsey.

Returns obj.

Yields:

  • (_self)

Yield Parameters:

  • _self (Object)

    the object that the method was called on



47
48
49
50
# File 'lib/mug/and-or.rb', line 47

def or_then &_block
  yield self unless self
  self
end