Class: Registrar::Provider::OpenSRS::Contact
- Inherits:
-
Object
- Object
- Registrar::Provider::OpenSRS::Contact
- Defined in:
- lib/registrar/provider/opensrs/contact.rb
Instance Attribute Summary collapse
-
#contact ⇒ Object
readonly
Returns the value of attribute contact.
Instance Method Summary collapse
-
#initialize(contact) ⇒ Contact
constructor
A new instance of Contact.
- #to_xml(builder) ⇒ Object
Constructor Details
#initialize(contact) ⇒ Contact
Returns a new instance of Contact.
8 9 10 11 |
# File 'lib/registrar/provider/opensrs/contact.rb', line 8 def initialize(contact) raise ArgumentError, "Contact is required" unless contact @contact = contact end |
Instance Attribute Details
#contact ⇒ Object (readonly)
Returns the value of attribute contact.
6 7 8 |
# File 'lib/registrar/provider/opensrs/contact.rb', line 6 def contact @contact end |
Instance Method Details
#to_xml(builder) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/registrar/provider/opensrs/contact.rb', line 13 def to_xml(builder) builder.item(contact.first_name, :key => "first_name") builder.item(contact.last_name, :key => "last_name") builder.item(contact.phone, :key => "phone") builder.item(contact.fax, :key => "fax") builder.item(contact.email, :key => "email") builder.item(contact.organization_name, :key => "org_name") builder.item(contact.address_1, :key => "address1") builder.item(contact.address_2, :key => "address2") builder.item(contact.city, :key => "city") builder.item(contact.state_province, :key => "state") builder.item(contact.country, :key => "country") builder.item(contact.postal_code, :key => "postal_code") end |