Sha256: 118fcafef6abeed645a3a168f76c50af66cd92f73a93ea5520f81f3acffd1cc3

Contents?: true

Size: 138 Bytes

Versions: 27

Compression:

Stored size: 138 Bytes

Contents

class Object
  def try(*args, &block)
    return if self.nil?
    block.given? ? yield(self) : self.__send__(args.shift, *args)
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
darkhelmet-darkext-0.5.0 lib/darkext/object.rb
darkhelmet-darkext-0.5.1 lib/darkext/object.rb
darkhelmet-darkext-0.5.2 lib/darkext/object.rb
darkhelmet-darkext-0.5.3 lib/darkext/object.rb
darkhelmet-darkext-0.5.4 lib/darkext/object.rb
darkhelmet-darkext-0.5.5 lib/darkext/object.rb
darkhelmet-darkext-0.5.6 lib/darkext/object.rb
darkhelmet-darkext-0.6.0 lib/darkext/object.rb
darkhelmet-darkext-0.7.0 lib/darkext/object.rb
darkhelmet-darkext-0.7.1 lib/darkext/object.rb
darkhelmet-darkext-0.7.2 lib/darkext/object.rb
darkhelmet-darkext-0.7.3 lib/darkext/object.rb
darkhelmet-darkext-0.8.0 lib/darkext/object.rb
darkhelmet-darkext-0.8.1 lib/darkext/object.rb
darkhelmet-darkext-0.8.2 lib/darkext/object.rb
darkhelmet-darkext-0.8.3 lib/darkext/object.rb
darkhelmet-darkext-0.8.4 lib/darkext/object.rb
darkhelmet-darkext-0.8.5 lib/darkext/object.rb
darkhelmet-darkext-0.8.6 lib/darkext/object.rb
darkhelmet-darkext-0.8.7 lib/darkext/object.rb