Sha256: da3d159731861c266fa2f123b4628337564c526cbd8e112827f2f175b9570258
Contents?: true
Size: 420 Bytes
Versions: 9
Compression:
Stored size: 420 Bytes
Contents
module AppInfo # Monkey Patch for Object module Tryable def try(*a, &b) try!(*a, &b) if a.empty? || respond_to?(a.first) end def try!(*a, &b) if a.empty? && block_given? if b.arity.zero? instance_eval(&b) else yield self end else public_send(*a, &b) end end end end # :nodoc: class Object include AppInfo::Tryable end
Version data entries
9 entries across 9 versions & 1 rubygems