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 = 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.
19 20 21 22 |
# File 'lib/fog/softlayer/models/network/datacenters.rb', line 19 def initialize(attributes) self.filters ||= {} super end |
Instance Method Details
#all(filters = filters) ⇒ Object
24 25 26 27 |
# File 'lib/fog/softlayer/models/network/datacenters.rb', line 24 def all(filters = filters) self.filters = filters load(service.get_datacenters.body) end |
#by_name(name) ⇒ Object
36 37 38 |
# File 'lib/fog/softlayer/models/network/datacenters.rb', line 36 def by_name(name) all.map { |dc| dc if dc.name == name }.compact.first end |