Module: Miasma::Contrib::RackspaceApiCore::ApiCommon
- Included in:
- Models::AutoScale::Rackspace, Models::Compute::Rackspace, Models::LoadBalancer::Rackspace, Models::Orchestration::Rackspace
- Defined in:
- lib/miasma/contrib/rackspace.rb
Overview
Common API methods
Class Method Summary collapse
-
.included(klass) ⇒ Object
Set attributes into model.
Instance Method Summary collapse
Class Method Details
.included(klass) ⇒ Object
Set attributes into model
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_api ⇒ Miasma::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 |