Class: Fog::Compute::Packet::Capacities

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/compute/packet/models/capacities.rb

Overview

Capacities Collection

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
13
# File 'lib/fog/compute/packet/models/capacities.rb', line 10

def all
  response = service.get_capacity
  new(response.body["capacity"])
end

#get(id) ⇒ Object



15
16
17
18
# File 'lib/fog/compute/packet/models/capacities.rb', line 15

def get(id)
  response = service.get_device(id)
  new(response.body)
end

#validate(options) ⇒ Object



20
21
22
23
# File 'lib/fog/compute/packet/models/capacities.rb', line 20

def validate(options)
  response = service.validate_capacity(options)
  true if response.status == 204
end