Module: Uploadr::Config
- Included in:
- Uploadr
- Defined in:
- lib/uploadr/config.rb
Constant Summary collapse
- VALID_OPTIONS_KEYS =
[ :worker_count, :directories, :config, :config_file ]
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.extended(base) ⇒ Object
14 15 16 |
# File 'lib/uploadr/config.rb', line 14 def self.extended(base) base.reset end |
Instance Method Details
#config ⇒ Object
26 27 28 |
# File 'lib/uploadr/config.rb', line 26 def config @config ||= ParseConfig.new(File.(config_file)) end |
#configure {|_self| ... } ⇒ Object
18 19 20 |
# File 'lib/uploadr/config.rb', line 18 def configure yield self end |
#options ⇒ Object
22 23 24 |
# File 'lib/uploadr/config.rb', line 22 def VALID_OPTIONS_KEYS.inject({}){|o,k| o.merge!(k => send(k)) } end |
#reset ⇒ Object
30 31 32 33 34 35 |
# File 'lib/uploadr/config.rb', line 30 def reset self.config = nil self.config_file = nil self.worker_count = nil self.directories = nil end |