Sha256: f7cd34012c426f174683953183f8ff58c524497bc89bcc6352f61bf1676f515f

Contents?: true

Size: 269 Bytes

Versions: 7

Compression:

Stored size: 269 Bytes

Contents

class Object
  # ActiveSupport's Object#try has difficulties if you 
  # try to use it on an instance of FalseClass (which 
  # I often seem to end up doing). Therefore...
  def try(method, *args, &block)
    send(method, *args, &block) if respond_to? method
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
junk_drawer-0.0.7 lib/core_extensions/object.rb
junk_drawer-0.0.6 lib/core_extensions/object.rb
junk_drawer-0.0.5 lib/core_extensions/object.rb
junk_drawer-0.0.4 lib/core_extensions/object.rb
junk_drawer-0.0.3 lib/core_extensions/object.rb
junk_drawer-0.0.2 lib/core_extensions/object.rb
junk_drawer-0.0.1 lib/core_extensions/object.rb