Class: Fog::HP::DNS::Record
- Defined in:
- lib/fog/hp/models/dns/record.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(new_attributes = {}) ⇒ Record
constructor
A new instance of Record.
- #save ⇒ 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(new_attributes = {}) ⇒ Record
Returns a new instance of Record.
20 21 22 23 24 |
# File 'lib/fog/hp/models/dns/record.rb', line 20 def initialize(new_attributes = {}) super(new_attributes) self.domain_id = domain.id if domain self end |
Instance Method Details
#destroy ⇒ Object
26 27 28 29 30 |
# File 'lib/fog/hp/models/dns/record.rb', line 26 def destroy requires :id, :domain_id service.delete_record(self.domain_id, id) true end |
#save ⇒ Object
32 33 34 |
# File 'lib/fog/hp/models/dns/record.rb', line 32 def save identity ? update : create end |