Module: Cli::Client
- Included in:
- Base
- Defined in:
- lib/cli/client.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
3 4 5 |
# File 'lib/cli/client.rb', line 3 def config @config end |
Instance Method Details
#client ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/cli/client.rb', line 5 def client load_config @client ||= Fog::Tasks.new(:provider => 'Wunderlist', :wunderlist_username => config[:username], :wunderlist_password => config[:password]) end |
#config_file ⇒ Object
25 26 27 |
# File 'lib/cli/client.rb', line 25 def config_file File.join(ENV['HOME'], '.wunderlist') end |
#load_config ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/cli/client.rb', line 13 def load_config if File.exists?(config_file) @config ||= YAML::load_file(config_file) else {} end end |
#save_config ⇒ Object
21 22 23 |
# File 'lib/cli/client.rb', line 21 def save_config File.open(self.class.config_file, 'w') {|f| f.write old_config.to_yaml } end |