Class: Resque::Pool::ConfigLoaders::FileOrHashLoader
- Inherits:
-
Object
- Object
- Resque::Pool::ConfigLoaders::FileOrHashLoader
- Defined in:
- lib/resque/pool/config_loaders/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.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/resque/pool/config_loaders/file_or_hash_loader.rb', line 6 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
17 18 19 |
# File 'lib/resque/pool/config_loaders/file_or_hash_loader.rb', line 17 def call(environment) @config ||= load_config_from_file(environment) end |
#reset! ⇒ Object
21 22 23 |
# File 'lib/resque/pool/config_loaders/file_or_hash_loader.rb', line 21 def reset! @config = nil end |