Class: Fog::DNS::Rage4::Record
- Inherits:
-
Model
- Object
- Model
- Fog::DNS::Rage4::Record
- Defined in:
- lib/fog/rage4/models/dns/record.rb
Instance Method Summary collapse
- #destroy ⇒ Object
- #domain ⇒ Object
-
#initialize(attributes = {}) ⇒ Record
constructor
A new instance of Record.
- #save ⇒ Object
- #zone ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Record
Returns a new instance of Record.
25 26 27 |
# File 'lib/fog/rage4/models/dns/record.rb', line 25 def initialize(attributes={}) super end |
Instance Method Details
#destroy ⇒ Object
33 34 35 36 |
# File 'lib/fog/rage4/models/dns/record.rb', line 33 def destroy service.delete_record(id) true end |
#domain ⇒ Object
29 30 31 |
# File 'lib/fog/rage4/models/dns/record.rb', line 29 def domain name end |
#save ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/fog/rage4/models/dns/record.rb', line 42 def save requires :name, :type, :value = {} [:priority] = priority if priority [:ttl] = ttl if ttl [:geozone] = geo_region_id if geo_region_id [:geolock] = geo_lock if geo_lock [:geolat] = geo_lat if geo_lat [:geolong] = geo_long if geo_long [:udplimit] = udp_limit if udp_limit # decide whether its a new record or update of an existing if id.nil? data = service.create_record(zone.id, name, value, type, ) else data = service.update_record(id, name, value, type, ) end merge_attributes() merge_attributes(:name => name, :value => value, :type => type) true end |
#zone ⇒ Object
38 39 40 |
# File 'lib/fog/rage4/models/dns/record.rb', line 38 def zone @zone end |