Class: Parser::Config
- Inherits:
-
Object
- Object
- Parser::Config
- Defined in:
- lib/parser/config.rb
Constant Summary collapse
- DEFAULTS =
{ from: '11:00', till: '20:00', users: { 1 => 'Timur Vafin', 2 => 'Alexey Mamaev', 3 => 'Oleg Kurnosov' } }.freeze
- OPTIONS =
[:from, :till, :users]
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #load!(file) ⇒ Object
- #reset! ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
20 21 22 |
# File 'lib/parser/config.rb', line 20 def initialize reset! end |
Instance Method Details
#load!(file) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/parser/config.rb', line 24 def load!(file) config = config_from_file(file) OPTIONS.each do |key| set_option(key, config[key]) if config.include?(key) end end |