Class: Taxbear::Config
- Inherits:
-
Object
- Object
- Taxbear::Config
- Defined in:
- lib/taxbear/config.rb
Class Method Summary collapse
-
.exists? ⇒ Boolean
Checks whether the Taxbear config file exists on the users computer.
-
.get_token ⇒ String
Returns the TaxJar API token loaded from the users config file.
-
.save_token(token) ⇒ Object
Saves the token to a .taxbear config file in the users home directory.
Class Method Details
.exists? ⇒ Boolean
Checks whether the Taxbear config file exists on the users computer.
9 10 11 |
# File 'lib/taxbear/config.rb', line 9 def exists? File.exist?(config_file) end |
.get_token ⇒ String
Returns the TaxJar API token loaded from the users config file.
16 17 18 |
# File 'lib/taxbear/config.rb', line 16 def get_token File.read(config_file) end |
.save_token(token) ⇒ Object
Saves the token to a .taxbear config file in the users home directory.
21 22 23 |
# File 'lib/taxbear/config.rb', line 21 def save_token(token) File.write(config_file, token) end |