Class: Fog::Network::Softlayer::Datacenters
- Inherits:
-
Collection
- Object
- Collection
- Fog::Network::Softlayer::Datacenters
- Defined in:
- lib/fog/softlayer/models/network/datacenters.rb
Instance Method Summary collapse
- #all(filters = self.filters) ⇒ Object
- #by_name(name) ⇒ Object
- #get(id) ⇒ Object
-
#initialize(attributes) ⇒ Datacenters
constructor
A new instance of Datacenters.
Constructor Details
#initialize(attributes) ⇒ Datacenters
Returns a new instance of Datacenters.
18 19 20 21 |
# File 'lib/fog/softlayer/models/network/datacenters.rb', line 18 def initialize(attributes) self.filters ||= {} super end |
Instance Method Details
#all(filters = self.filters) ⇒ Object
23 24 25 26 |
# File 'lib/fog/softlayer/models/network/datacenters.rb', line 23 def all(filters = self.filters) self.filters = filters load(service.get_datacenters.body) end |
#by_name(name) ⇒ Object
35 36 37 |
# File 'lib/fog/softlayer/models/network/datacenters.rb', line 35 def by_name(name) all.map { |dc| dc if dc.name == name }.compact.first end |