Class: Fog::DNS::Google::Changes

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/google/models/dns/changes.rb

Instance Method Summary collapse

Instance Method Details

#allArray<Fog::DNS::Google::Change>

Enumerates the list of Changes

Returns:



16
17
18
19
20
21
22
23
# File 'lib/fog/google/models/dns/changes.rb', line 16

def all
  requires :zone

  data = service.list_changes(zone.identity).body['changes'] || []
  load(data)
rescue Fog::Errors::NotFound
  []
end

#get(identity) ⇒ Fog::DNS::Google::Change

Fetches the representation of an existing Change

Parameters:

  • identity (String)

    Change identity

Returns:



30
31
32
33
34
35
36
37
38
# File 'lib/fog/google/models/dns/changes.rb', line 30

def get(identity)
  requires :zone

  if change = service.get_change(zone.identity, identity).body
    new(change)
  end
rescue Fog::Errors::NotFound
  nil
end

#new(attributes = {}) ⇒ Fog::DNS::Google::Change

Creates a new instance of a Change

Returns:



44
45
46
47
48
# File 'lib/fog/google/models/dns/changes.rb', line 44

def new(attributes = {})
  requires :zone

  super({ :zone => zone }.merge!(attributes))
end