Class: Summon::CLI::Config

Inherits:
Object show all
Defined in:
lib/summon/cli.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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

.loadObject



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

#optionsObject



142
143
144
# File 'lib/summon/cli.rb', line 142

def options
  {:url => @url, :access_id => @access_id, :secret_key => @secret_key}
end