Class: Dumper::Profile

Inherits:
Object
  • Object
show all
Includes:
Alakazam, Dumper
Defined in:
lib/dumper/profile.rb

Constant Summary

Constants included from Dumper

USER_AGENT

Instance Method Summary collapse

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
# 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
  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

Raises:

  • (NotImplementedError)


37
38
39
# File 'lib/dumper/profile.rb', line 37

def dump(url, path, *args)
  raise NotImplementedError
end

#shutdownObject



41
42
43
# File 'lib/dumper/profile.rb', line 41

def shutdown
  @pool.shutdown
end