Class: Resque::Pool::FileOrHashLoader
- Inherits:
-
Object
- Object
- Resque::Pool::FileOrHashLoader
- Defined in:
- lib/resque/pool/file_or_hash_loader.rb
Instance Method Summary collapse
- #call(environment) ⇒ Object
-
#initialize(filename_or_hash = nil) ⇒ FileOrHashLoader
constructor
A new instance of FileOrHashLoader.
- #reset! ⇒ Object
Constructor Details
#initialize(filename_or_hash = nil) ⇒ FileOrHashLoader
Returns a new instance of FileOrHashLoader.
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/resque/pool/file_or_hash_loader.rb', line 4 def initialize(filename_or_hash=nil) case filename_or_hash when String, nil @filename = filename_or_hash when Hash @static_config = filename_or_hash.dup else raise "#{self.class} cannot be initialized with #{filename_or_hash.inspect}" end end |
Instance Method Details
#call(environment) ⇒ Object
15 16 17 |
# File 'lib/resque/pool/file_or_hash_loader.rb', line 15 def call(environment) @config ||= load_config_from_file(environment) end |
#reset! ⇒ Object
19 20 21 |
# File 'lib/resque/pool/file_or_hash_loader.rb', line 19 def reset! @config = nil end |