Method: Object#try!
- Defined in:
- lib/elected/core_ext.rb
#try!(*a, &b) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/elected/core_ext.rb', line 15 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 |