Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/jdc/object_extensions.rb
Instance Method Summary collapse
Instance Method Details
#try(*a, &b) ⇒ Object
2 3 4 5 6 7 8 |
# File 'lib/jdc/object_extensions.rb', line 2 def try(*a, &b) if a.empty? && block_given? yield self else __send__(*a, &b) end end |