Module: Miasma::Contrib::RackspaceApiCore::ApiCommon

Overview

Common API methods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object

Set attributes into model

Parameters:

  • klass (Class)


34
35
36
37
38
39
40
41
# File 'lib/miasma/contrib/rackspace.rb', line 34

def self.included(klass)
  klass.attributes.clear
  klass.class_eval do
    attribute :rackspace_api_key, String, :required => true
    attribute :rackspace_username, String, :required => true
    attribute :rackspace_region, String, :required => true
  end
end

Instance Method Details

#open_stack_apiMiasma::Contrib::RackspaceApiCore



44
45
46
47
48
49
# File 'lib/miasma/contrib/rackspace.rb', line 44

def open_stack_api
  key = "miasma_rackspace_api_#{attributes.checksum}".to_sym
  memoize(key, :direct) do
    Miasma::Contrib::RackspaceApiCore.new(attributes)
  end
end