Class: Bitsa::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/bitsa/settings.rb

Overview

Application settings.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cache_file_pathObject (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

#loginObject (readonly)

Login to use to connect to GMail.



26
27
28
# File 'lib/bitsa/settings.rb', line 26

def 
  @login
end

#passwordObject (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, options)
  @login = config_file_hash.data[:login]
  @password = config_file_hash.data[:password]
  @cache_file_path = config_file_hash.data[:cache_file_path]

  @login = options[:login] if options[:login]
  @password = options[:password] if options[:password]
  @cache_file_path = options[:cache_file_path] if options[:cache_file_path]
end