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

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

Instance Method Summary collapse

Instance Method Details

#allObject



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

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

#get(identity) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/fog/google/models/compute/routes.rb', line 15

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