Class: Summon::CLI::Config
Instance Attribute Summary collapse
-
#access_id(access_id) ⇒ Object
readonly
Returns the value of attribute access_id.
-
#secret_key(secret_key) ⇒ Object
readonly
Returns the value of attribute secret_key.
-
#url(url) ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
- #client_key(name) ⇒ Object
- #clients(h) ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #options ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
112 113 114 |
# File 'lib/summon/cli.rb', line 112 def initialize @clients = {} end |
Instance Attribute Details
#access_id(access_id) ⇒ Object (readonly)
Returns the value of attribute access_id.
110 111 112 |
# File 'lib/summon/cli.rb', line 110 def access_id @access_id end |
#secret_key(secret_key) ⇒ Object (readonly)
Returns the value of attribute secret_key.
110 111 112 |
# File 'lib/summon/cli.rb', line 110 def secret_key @secret_key end |
#url(url) ⇒ Object (readonly)
Returns the value of attribute url.
110 111 112 |
# File 'lib/summon/cli.rb', line 110 def url @url end |
Class Method Details
.load ⇒ Object
116 117 118 119 120 121 122 |
# File 'lib/summon/cli.rb', line 116 def self.load summonrc = "#{ENV['HOME']}/.summonrc" FileUtils.touch summonrc unless File.exists?(summonrc) new.tap do |this| this.instance_eval(File.read(summonrc), summonrc, 1) end end |
Instance Method Details
#client_key(name) ⇒ Object
140 141 142 |
# File 'lib/summon/cli.rb', line 140 def client_key(name) @clients[name.to_sym] || name end |
#clients(h) ⇒ Object
136 137 138 |
# File 'lib/summon/cli.rb', line 136 def clients(h) @clients = h end |
#options ⇒ Object
144 145 146 |
# File 'lib/summon/cli.rb', line 144 def {:url => @url, :access_id => @access_id, :secret_key => @secret_key} end |