Class: Bitsa::Settings
- Inherits:
-
Object
- Object
- Bitsa::Settings
- Defined in:
- lib/bitsa/settings.rb
Overview
Application settings.
Instance Attribute Summary collapse
-
#cache_file_path ⇒ Object
readonly
Path to file to store cached contact information in.
-
#login ⇒ Object
readonly
Login to use to connect to GMail.
-
#password ⇒ Object
readonly
Password to use to connect to GMail.
Instance Method Summary collapse
-
#load(config_file_hash, options) ⇒ Object
Load settings from a hash of data from the configuration file and options passed on the command line.
Instance Attribute Details
#cache_file_path ⇒ Object (readonly)
Path to file to store cached contact information in.
32 33 34 |
# File 'lib/bitsa/settings.rb', line 32 def cache_file_path @cache_file_path end |
#login ⇒ Object (readonly)
Login to use to connect to GMail.
26 27 28 |
# File 'lib/bitsa/settings.rb', line 26 def login @login end |
#password ⇒ Object (readonly)
Password to use to connect to GMail.
29 30 31 |
# File 'lib/bitsa/settings.rb', line 29 def password @password end |
Instance Method Details
#load(config_file_hash, options) ⇒ Object
Load settings from a hash of data from the configuration file and options passed on the command line.
Options passed on the command line override those in the configuration file.
39 40 41 42 43 44 45 46 47 |
# File 'lib/bitsa/settings.rb', line 39 def load(config_file_hash, ) @login = config_file_hash.data[:login] @password = config_file_hash.data[:password] @cache_file_path = config_file_hash.data[:cache_file_path] @login = [:login] if [:login] @password = [:password] if [:password] @cache_file_path = [:cache_file_path] if [:cache_file_path] end |