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.
24 25 26 27 |
# File 'lib/fog/softlayer/models/dns/record.rb', line 24 def initialize(attributes={}) self.domain_id = attributes[:domain_id] super(attributes) end |
Instance Method Details
#destroy ⇒ Object
29 30 31 32 |
# File 'lib/fog/softlayer/models/dns/record.rb', line 29 def destroy response = service.delete_record(identity) response.body end |
#save ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fog/softlayer/models/dns/record.rb', line 34 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 |