Class: DNSimple::TransferOrder
- Defined in:
- lib/dnsimple/transfer_order.rb
Overview
Represents a transfer order.
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from DNSimple::Base
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
6 7 8 |
# File 'lib/dnsimple/transfer_order.rb', line 6 def id @id end |
#status ⇒ Object
Returns the value of attribute status.
8 9 10 |
# File 'lib/dnsimple/transfer_order.rb', line 8 def status @status end |
Class Method Details
.create(name, authinfo = '', registrant = {}, extended_attributes = {}, options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/dnsimple/transfer_order.rb', line 10 def self.create(name, authinfo='', registrant={}, extended_attributes={}, ={}) body = {:domain => {:name => name}, :transfer_order => {:authinfo => authinfo}} if registrant[:id] body[:domain][:registrant_id] = registrant[:id] else body.merge!(:contact => Contact.resolve_attributes(registrant)) end body.merge!(:extended_attribute => extended_attributes) .merge!({:body => body}) response = DNSimple::Client.post("/v1/domain_transfers", ) case response.code when 201 new(response["transfer_order"]) else raise RequestError.new("Error creating transfer order", response) end end |