Class: EY::EYRC
Constant Summary collapse
- DEFAULT_PATH =
"~/.eyrc"
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
- #api_token ⇒ Object
- #api_token=(token) ⇒ Object
- #delete_api_token ⇒ Object
- #exist? ⇒ Boolean
-
#initialize(path) ⇒ EYRC
constructor
A new instance of EYRC.
Constructor Details
#initialize(path) ⇒ EYRC
Returns a new instance of EYRC.
11 12 13 |
# File 'lib/engineyard/eyrc.rb', line 11 def initialize(path) self.path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/engineyard/eyrc.rb', line 3 def path @path end |
Class Method Details
.load ⇒ Object
7 8 9 |
# File 'lib/engineyard/eyrc.rb', line 7 def self.load new(ENV['EYRC'] || DEFAULT_PATH) end |
Instance Method Details
#api_token ⇒ Object
23 24 25 |
# File 'lib/engineyard/eyrc.rb', line 23 def api_token self['api_token'] end |
#api_token=(token) ⇒ Object
27 28 29 |
# File 'lib/engineyard/eyrc.rb', line 27 def api_token=(token) self['api_token'] = token end |
#delete_api_token ⇒ Object
19 20 21 |
# File 'lib/engineyard/eyrc.rb', line 19 def delete_api_token delete('api_token') end |
#exist? ⇒ Boolean
15 16 17 |
# File 'lib/engineyard/eyrc.rb', line 15 def exist? path.exist? end |