Module: Sym::Extensions::WithTimeout

Included in:
App::Password::Cache
Defined in:
lib/sym/extensions/with_timeout.rb

Instance Method Summary collapse

Instance Method Details

#with_timeout(timeout = 3) ⇒ Object



5
6
7
8
9
# File 'lib/sym/extensions/with_timeout.rb', line 5

def with_timeout(timeout = 3)
  status = Timeout.timeout(timeout) {
    yield if block_given?
  }
end