Class: Rackspace::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/rackspace.rb

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Configuration

Returns a new instance of Configuration.



25
26
27
28
29
# File 'lib/capistrano/rackspace.rb', line 25

def initialize(options = {})
  [ :username, :api_key, :region, :autoscale_group ].each do |attr|
    instance_variable_set "@#{attr}", options[attr]
  end
end

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



9
10
11
# File 'lib/capistrano/rackspace.rb', line 9

def api_key
  @api_key
end

.autoscale_groupObject

Returns the value of attribute autoscale_group.



11
12
13
# File 'lib/capistrano/rackspace.rb', line 11

def autoscale_group
  @autoscale_group
end

.regionObject

Returns the value of attribute region.



10
11
12
# File 'lib/capistrano/rackspace.rb', line 10

def region
  @region
end

.usernameObject

Returns the value of attribute username.



8
9
10
# File 'lib/capistrano/rackspace.rb', line 8

def username
  @username
end

Instance Attribute Details

#autoscale_groupObject (readonly)

Returns the value of attribute autoscale_group.



14
15
16
# File 'lib/capistrano/rackspace.rb', line 14

def autoscale_group
  @autoscale_group
end

Class Method Details

.instantiateObject



16
17
18
19
20
21
22
23
# File 'lib/capistrano/rackspace.rb', line 16

def self.instantiate
  new(
    :username => username,
    :api_key => api_key,
    :region => region,
    :autoscale_group => autoscale_group
  )
end

Instance Method Details

#commonObject



31
32
33
34
35
36
37
# File 'lib/capistrano/rackspace.rb', line 31

def common
  {
    :rackspace_username => @username,
    :rackspace_api_key => @api_key,
    :rackspace_region => @region
  }
end

#computeObject



39
40
41
# File 'lib/capistrano/rackspace.rb', line 39

def compute
  common.merge(:provider => 'Rackspace', :version => :v2)
end