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.
110 111 112 |
# File 'lib/summon/cli.rb', line 110 def initialize @clients = {} end |
Instance Attribute Details
#access_id(access_id) ⇒ Object (readonly)
Returns the value of attribute access_id.
108 109 110 |
# File 'lib/summon/cli.rb', line 108 def access_id @access_id end |
#secret_key(secret_key) ⇒ Object (readonly)
Returns the value of attribute secret_key.
108 109 110 |
# File 'lib/summon/cli.rb', line 108 def secret_key @secret_key end |
#url(url) ⇒ Object (readonly)
Returns the value of attribute url.
108 109 110 |
# File 'lib/summon/cli.rb', line 108 def url @url end |
Class Method Details
.load ⇒ Object
114 115 116 117 118 119 120 |
# File 'lib/summon/cli.rb', line 114 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
138 139 140 |
# File 'lib/summon/cli.rb', line 138 def client_key(name) @clients[name.to_sym] || name end |
#clients(h) ⇒ Object
134 135 136 |
# File 'lib/summon/cli.rb', line 134 def clients(h) @clients = h end |
#options ⇒ Object
142 143 144 |
# File 'lib/summon/cli.rb', line 142 def {:url => @url, :access_id => @access_id, :secret_key => @secret_key} end |