Class: Bitsa::Settings
- Inherits:
-
Object
- Object
- Bitsa::Settings
- Defined in:
- lib/bitsa/settings.rb
Overview
Application settings.
Instance Attribute Summary collapse
-
#auto_check ⇒ Object
readonly
Number of days before auto checking.
-
#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
#auto_check ⇒ Object (readonly)
Number of days before auto checking
35 36 37 |
# File 'lib/bitsa/settings.rb', line 35 def auto_check @auto_check end |
#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.
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/bitsa/settings.rb', line 42 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] @auto_check = config_file_hash.data[:auto_check] @login = [:login] if [:login] @password = [:password] if [:password] @cache_file_path = [:cache_file_path] if [:cache_file_path] @auto_check = [:auto_check] if [:auto_check] @auto_check ||= 1 @cache_file_path ||= "~/.bitsa_cache.yml" end |