Class: Fog::DNS::Softlayer::Record
- Inherits:
-
Model
- Object
- Model
- Fog::DNS::Softlayer::Record
- Defined in:
- lib/fog/softlayer/models/dns/record.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ Record
constructor
A new instance of Record.
- #save ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Record
Returns a new instance of Record.
25 26 27 28 |
# File 'lib/fog/softlayer/models/dns/record.rb', line 25 def initialize(attributes={}) self.domain_id = attributes[:domain_id] super(attributes) end |
Instance Method Details
#destroy ⇒ Object
30 31 32 33 |
# File 'lib/fog/softlayer/models/dns/record.rb', line 30 def destroy response = service.delete_record(identity) response.body end |
#save ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/fog/softlayer/models/dns/record.rb', line 35 def save requires :name, :type, :value, :domain_id opts = generate_template # to save or to update, thats the question if id.nil? data = service.create_record(opts) merge_attributes(data.body) else data = service.update_record(self.id, opts) end true end |