Class: Fog::DNS::Google::Changes
- Inherits:
-
Collection
- Object
- Collection
- Fog::DNS::Google::Changes
- Defined in:
- lib/fog/dns/google/models/changes.rb
Instance Method Summary collapse
-
#all ⇒ Array<Fog::DNS::Google::Change>
Enumerates the list of Changes.
-
#get(identity) ⇒ Fog::DNS::Google::Change
Fetches the representation of an existing Change.
-
#new(attributes = {}) ⇒ Fog::DNS::Google::Change
Creates a new instance of a Change.
Instance Method Details
#all ⇒ Array<Fog::DNS::Google::Change>
Enumerates the list of Changes
13 14 15 16 17 18 19 20 |
# File 'lib/fog/dns/google/models/changes.rb', line 13 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
27 28 29 30 31 32 33 34 35 |
# File 'lib/fog/dns/google/models/changes.rb', line 27 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
41 42 43 44 45 |
# File 'lib/fog/dns/google/models/changes.rb', line 41 def new(attributes = {}) requires :zone super({ :zone => zone }.merge!(attributes)) end |