Class: Deploy::Configuration
- Inherits:
-
Object
- Object
- Deploy::Configuration
- Defined in:
- lib/deploy/configuration.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#project ⇒ Object
Returns the value of attribute project.
-
#username ⇒ Object
Returns the value of attribute username.
- #websocket_hostname ⇒ Object
Class Method Summary collapse
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
3 4 5 |
# File 'lib/deploy/configuration.rb', line 3 def account @account end |
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/deploy/configuration.rb', line 3 def api_key @api_key end |
#project ⇒ Object
Returns the value of attribute project.
3 4 5 |
# File 'lib/deploy/configuration.rb', line 3 def project @project end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/deploy/configuration.rb', line 3 def username @username end |
#websocket_hostname ⇒ Object
6 7 8 |
# File 'lib/deploy/configuration.rb', line 6 def websocket_hostname @websocket_hostname || 'wss://websocket.deployhq.com' end |
Class Method Details
.from_file(path) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/deploy/configuration.rb', line 10 def self.from_file(path) file_contents = File.read(path) parsed_contents = JSON.parse(file_contents) self.new.tap do |config| config.account = parsed_contents['account'] config.username = parsed_contents['username'] config.api_key = parsed_contents['api_key'] config.project = parsed_contents['project'] config.websocket_hostname = parsed_contents['websocket_hostname'] end end |