Module: Retryable
Instance Method Summary collapse
Instance Method Details
#try(times = 1, options = {}, &block) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/hostelify/hostelify.rb', line 53 def try times = 1, = {}, &block val = yield rescue [:on] || Exception retry if (times -= 1) > 0 else val end |