Class: BookmeterScraper::Configuration
- Inherits:
-
Object
- Object
- BookmeterScraper::Configuration
- Defined in:
- lib/bookmeter_scraper/configuration.rb
Instance Attribute Summary collapse
-
#mail ⇒ Object
Returns the value of attribute mail.
-
#password ⇒ Object
Returns the value of attribute password.
Instance Method Summary collapse
-
#initialize(config_file = nil) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(config_file = nil) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/bookmeter_scraper/configuration.rb', line 5 def initialize(config_file = nil) if config_file.nil? @mail = @password = '' return end config = load_yaml_file(config_file) unless config.has_key?('mail') && config.has_key?('password') raise ConfigurationError, "#{config_file}: Invalid configuration file" end @mail = config['mail'] @password = config['password'] end |
Instance Attribute Details
#mail ⇒ Object
Returns the value of attribute mail.
3 4 5 |
# File 'lib/bookmeter_scraper/configuration.rb', line 3 def mail @mail end |
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/bookmeter_scraper/configuration.rb', line 3 def password @password end |