Class: Feedbook::Configuration
- Inherits:
-
Object
- Object
- Feedbook::Configuration
- Defined in:
- lib/feedbook/configuration.rb
Constant Summary collapse
- INTERVAL_FORMAT =
/\A(\d+)(s|m|h|d)\z/
Instance Attribute Summary collapse
-
#interval ⇒ Object
readonly
Returns the value of attribute interval.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ NilClass
constructor
Initializes new Configuration object with configuration for program instance.
-
#load_notifiers ⇒ NilClass
Load notifiers configuration.
Constructor Details
#initialize(opts = {}) ⇒ NilClass
Initializes new Configuration object with configuration for program instance
14 15 16 17 |
# File 'lib/feedbook/configuration.rb', line 14 def initialize(opts = {}) @interval = Helpers::TimeIntervalParser.parse opts.delete('interval') @options = opts end |
Instance Attribute Details
#interval ⇒ Object (readonly)
Returns the value of attribute interval.
6 7 8 |
# File 'lib/feedbook/configuration.rb', line 6 def interval @interval end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/feedbook/configuration.rb', line 6 def @options end |
Instance Method Details
#load_notifiers ⇒ NilClass
Load notifiers configuration
22 23 24 25 26 27 |
# File 'lib/feedbook/configuration.rb', line 22 def load_notifiers .each do |name, config| notifier = Factories::NotifiersFactory.create(name) notifier.load_configuration(config) unless notifier.nil? end end |