Class: Dumper::Profile
- Inherits:
-
Object
- Object
- Dumper::Profile
- Includes:
- Dumper, Observable
- Defined in:
- lib/dumper/profile.rb
Constant Summary
Constants included from Dumper
Instance Method Summary collapse
- #dump(url, path, *args) ⇒ Object
-
#initialize(&block) ⇒ Profile
constructor
A new instance of Profile.
- #shutdown ⇒ Object
Methods included from Dumper
get, get_generic, list, #method_missing, #mute?, #pool_size, pool_size=, shut_up!, verbose!, verbose=, verbose?, #verbose?, version
Constructor Details
#initialize(&block) ⇒ Profile
Returns a new instance of Profile.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dumper/profile.rb', line 25 def initialize(&block) add_observer Dumper::Logger.new min = pool_size[:min] max = pool_size[:max] @pool = Thread.pool min, max changed notify_observers error: "Using #{min}:#{max || min} threads..." instance_eval &block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Dumper
Instance Method Details
#dump(url, path, *args) ⇒ Object
38 39 40 |
# File 'lib/dumper/profile.rb', line 38 def dump(url, path, *args) raise NotImplementedError end |
#shutdown ⇒ Object
42 43 44 |
# File 'lib/dumper/profile.rb', line 42 def shutdown @pool.shutdown end |