Class: Object

Inherits:
BasicObject
Defined in:
lib/nulldb/extensions.rb,
lib/nulldb/extensions.rb

Instance Method Summary collapse

Instance Method Details

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Object)

    the object that the method was called on



3
4
5
6
# File 'lib/nulldb/extensions.rb', line 3

def tap
  yield self
  self
end

#try(*a, &b) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/nulldb/extensions.rb', line 12

def try(*a, &b)
  if a.empty? && block_given?
    yield self
  else
    __send__(*a, &b)
  end
end