Class: Fog::DNS::Rage4::Record
- Defined in:
- lib/fog/rage4/models/dns/record.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #destroy ⇒ Object
- #domain ⇒ Object
-
#initialize(attributes = {}) ⇒ Record
constructor
A new instance of Record.
- #save ⇒ Object
- #zone ⇒ Object
Methods inherited from Model
#inspect, #reload, #symbolize_keys, #to_json, #wait_for
Methods included from Attributes::ClassMethods
#_load, #aliases, #attribute, #attributes, #identity, #ignore_attributes, #ignored_attributes
Methods included from Core::DeprecatedConnectionAccessors
#connection, #connection=, #prepare_service_value
Methods included from Attributes::InstanceMethods
#_dump, #attributes, #dup, #identity, #identity=, #merge_attributes, #new_record?, #persisted?, #requires, #requires_one
Constructor Details
#initialize(attributes = {}) ⇒ Record
Returns a new instance of Record.
28 29 30 |
# File 'lib/fog/rage4/models/dns/record.rb', line 28 def initialize(attributes={}) super end |
Instance Method Details
#destroy ⇒ Object
36 37 38 39 |
# File 'lib/fog/rage4/models/dns/record.rb', line 36 def destroy service.delete_record(id) true end |
#domain ⇒ Object
32 33 34 |
# File 'lib/fog/rage4/models/dns/record.rb', line 32 def domain name end |
#save ⇒ Object
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/fog/rage4/models/dns/record.rb', line 45 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 # 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
41 42 43 |
# File 'lib/fog/rage4/models/dns/record.rb', line 41 def zone @zone end |