Class: Fog::Compute::Google::Routes

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

Instance Method Summary collapse

Instance Method Details

#allObject



7
8
9
10
# File 'lib/fog/compute/google/models/routes.rb', line 7

def all
  data = service.list_routes.body
  load(data["items"] || [])
end

#get(identity) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/fog/compute/google/models/routes.rb', line 12

def get(identity)
  if route = service.get_route(identity).body
    new(route)
  end
rescue Fog::Errors::NotFound
  nil
end