Class: BetterThread
- Inherits:
-
Object
- Object
- BetterThread
- Extended by:
- Forwardable
- Defined in:
- lib/better_thread.rb
Instance Method Summary collapse
-
#initialize(opts = {}, &block) ⇒ BetterThread
constructor
A new instance of BetterThread.
- #timeout? ⇒ Boolean
Constructor Details
#initialize(opts = {}, &block) ⇒ BetterThread
Returns a new instance of BetterThread.
10 11 12 13 14 15 |
# File 'lib/better_thread.rb', line 10 def initialize(opts = {}, &block) @timeout = false __better_thread_killer opts[:timeout] if opts[:timeout] @thread = ::Thread.send :new, &block end |
Instance Method Details
#timeout? ⇒ Boolean
17 18 19 |
# File 'lib/better_thread.rb', line 17 def timeout? @timeout end |