Class: DeltacloudVM::Client::Driver
- Defined in:
- lib/deltacloud_vm/client/models/driver.rb
Defined Under Namespace
Classes: Provider
Instance Attribute Summary collapse
-
#providers ⇒ Object
readonly
Returns the value of attribute providers.
Attributes inherited from Base
#description, #name, #obj_id, #url
Class Method Summary collapse
Instance Method Summary collapse
-
#[](provider_id) ⇒ Object
Syntax sugar for returning provider from Driver instance:.
Methods inherited from Base
#client, #connection, convert, #entrypoint, from_collection, #id, #initialize, #original_body, #to_s, #update_instance_variables!, validate_attrs!
Methods included from Helpers::XmlHelper
Methods included from Methods::Api
#api_uri, #current_driver, #current_provider, #feature?, #features, #must_support!, #path, #support?, #supported_collections, #version
Methods included from Helpers::Model
#error, #from_collection, #from_resource, #model
Constructor Details
This class inherits a constructor from DeltacloudVM::Client::Base
Instance Attribute Details
#providers ⇒ Object (readonly)
Returns the value of attribute providers.
20 21 22 |
# File 'lib/deltacloud_vm/client/models/driver.rb', line 20 def providers @providers end |
Class Method Details
Instance Method Details
#[](provider_id) ⇒ Object
Syntax sugar for returning provider from Driver instance:
client.driver(:ec2) # => List of endpoints
-
provider_id -> Provider ID, like ‘us-west-1’
29 30 31 32 33 34 |
# File 'lib/deltacloud_vm/client/models/driver.rb', line 29 def [](provider_id) @providers ||= [] prov = @providers.find { |p| p.name == provider_id } prov.instance_variable_set('@client', @client) prov end |