Module: Gemmy::Patches::ObjectPatch::InstanceMethods::Try

Defined in:
lib/gemmy/patches/object_patch.rb

Instance Method Summary collapse

Instance Method Details

#try(method = nil, *args, &block) ⇒ Object

facets nicer than the builtin @people.try(:collect){ |p| p.name }



72
73
74
75
76
77
78
# File 'lib/gemmy/patches/object_patch.rb', line 72

def try(method=nil, *args, &block)
  if method
    __send__(method, *args, &block)
  else
    self
  end
end