Class: Fog::Compute::ProfitBricks::Snapshots

Inherits:
Fog::Collection
  • Object
show all
Includes:
Helpers::ProfitBricks::DataHelper
Defined in:
lib/fog/profitbricks/models/compute/snapshots.rb

Instance Method Summary collapse

Methods included from Helpers::ProfitBricks::DataHelper

#flatten

Instance Method Details

#allObject



11
12
13
14
15
# File 'lib/fog/profitbricks/models/compute/snapshots.rb', line 11

def all
  result = service.get_all_snapshots

  load(result.body['items'].each { |snapshot| flatten(snapshot) })
end

#get(id) ⇒ Object



17
18
19
20
21
# File 'lib/fog/profitbricks/models/compute/snapshots.rb', line 17

def get(id)
  snapshot = service.get_snapshot(id).body

  new(flatten(snapshot))
end