Class: Skewer::Rackspace::Service

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

Instance Method Summary collapse

Constructor Details

#initialize(short_region_name) ⇒ Service

Returns a new instance of Service.



4
5
6
# File 'lib/rackspace/service.rb', line 4

def initialize(short_region_name)
  @region = region(short_region_name)
end

Instance Method Details

#buildObject



13
14
15
16
17
18
19
# File 'lib/rackspace/service.rb', line 13

def build
  Fog::Compute.new(
      :provider => 'Rackspace',
      :rackspace_api_key => Fog.credentials[:rackspace_api_key],
      :rackspace_username => Fog.credentials[:rackspace_username],
      :rackspace_auth_url => @region)
end

#region(short_region_name = nil) ⇒ Object



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

def region(short_region_name = nil)
  short_region_name.to_s == 'lon' ? "lon.auth.api.rackspacecloud.com" :
      "auth.api.rackspacecloud.com"
end