Class: Object

Inherits:
BasicObject
Defined in:
lib/smalltalkable.rb

Instance Method Summary collapse

Instance Method Details

#if_nil(true_proc, opts = {}) ⇒ Object Also known as: ifNil



93
94
95
# File 'lib/smalltalkable.rb', line 93

def if_nil(true_proc, opts={})
  (opts[:if_not_nil] || opts[:ifNotNil] || ->{nil}).call
end

#if_not_nil(true_proc, opts = {}) ⇒ Object Also known as: ifNotNil



98
99
100
# File 'lib/smalltalkable.rb', line 98

def if_not_nil(true_proc, opts={})
  true_proc.call
end