Class: Git2Mite::Configuration
- Inherits:
-
Object
- Object
- Git2Mite::Configuration
- Defined in:
- lib/git2mite/configuration.rb
Instance Method Summary collapse
- #api_key ⇒ Object
- #api_key=(value) ⇒ Object
-
#initialize(config_file = nil) ⇒ Configuration
constructor
A new instance of Configuration.
- #sub_domain ⇒ Object
- #sub_domain=(value) ⇒ Object
Constructor Details
#initialize(config_file = nil) ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 |
# File 'lib/git2mite/configuration.rb', line 5 def initialize(config_file = nil) @config_file = config_file || ENV['HOME'] + '/.git2mite.yml' if File.exist?(@config_file) @config = load_config else @config = {} end end |
Instance Method Details
#api_key ⇒ Object
14 15 16 |
# File 'lib/git2mite/configuration.rb', line 14 def api_key @config[:api_key] end |
#api_key=(value) ⇒ Object
28 29 30 31 32 |
# File 'lib/git2mite/configuration.rb', line 28 def api_key=(value) @config[:api_key] = value.strip store_config @config[:api_key] end |
#sub_domain ⇒ Object
18 19 20 |
# File 'lib/git2mite/configuration.rb', line 18 def sub_domain @config[:sub_domain] end |
#sub_domain=(value) ⇒ Object
22 23 24 25 26 |
# File 'lib/git2mite/configuration.rb', line 22 def sub_domain=(value) @config[:sub_domain] = value.strip store_config @config[:sub_domain] end |