Class: Skewer::Rackspace::Service
- Inherits:
-
Object
- Object
- Skewer::Rackspace::Service
- Defined in:
- lib/rackspace/service.rb
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(short_region_name) ⇒ Service
constructor
A new instance of Service.
- #region(short_region_name = nil) ⇒ Object
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
#build ⇒ Object
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 |