Class: Fog::DNS::Google::Records
- Inherits:
-
Collection
- Object
- Collection
- Fog::DNS::Google::Records
- Defined in:
- lib/fog/google/models/dns/records.rb
Instance Method Summary collapse
-
#all ⇒ Array<Fog::DNS::Google::Record>
Enumerates Resource Record Sets that have been created but not yet deleted.
-
#get(name, type) ⇒ Fog::DNS::Google::Record
Fetches the representation of an existing Resource Record Set.
-
#new(attributes = {}) ⇒ Fog::DNS::Google::Record
Creates a new instance of a Resource Record Set.
Instance Method Details
#all ⇒ Array<Fog::DNS::Google::Record>
Enumerates Resource Record Sets that have been created but not yet deleted
16 17 18 19 20 21 22 23 |
# File 'lib/fog/google/models/dns/records.rb', line 16 def all requires :zone data = service.list_resource_record_sets(zone.identity).body['rrsets'] || [] load(data) rescue Fog::Errors::NotFound [] end |
#get(name, type) ⇒ Fog::DNS::Google::Record
Fetches the representation of an existing Resource Record Set
31 32 33 34 35 36 37 38 |
# File 'lib/fog/google/models/dns/records.rb', line 31 def get(name, type) requires :zone records = service.list_resource_record_sets(zone.identity, { :name => name, :type => type }).body['rrsets'] || [] records.any? ? new(records.first) : nil rescue Fog::Errors::NotFound nil end |
#new(attributes = {}) ⇒ Fog::DNS::Google::Record
Creates a new instance of a Resource Record Set
44 45 46 47 48 |
# File 'lib/fog/google/models/dns/records.rb', line 44 def new(attributes = {}) requires :zone super({ :zone => zone }.merge!(attributes)) end |