Class: Registrar::Provider::OpenSRS::NameServerList
- Inherits:
-
Object
- Object
- Registrar::Provider::OpenSRS::NameServerList
- Defined in:
- lib/registrar/provider/opensrs/name_server_list.rb
Instance Attribute Summary collapse
-
#nameservers ⇒ Object
readonly
Returns the value of attribute nameservers.
Instance Method Summary collapse
-
#initialize(purchase_options) ⇒ NameServerList
constructor
A new instance of NameServerList.
- #to_xml(context) ⇒ Object
Constructor Details
#initialize(purchase_options) ⇒ NameServerList
Returns a new instance of NameServerList.
7 8 9 |
# File 'lib/registrar/provider/opensrs/name_server_list.rb', line 7 def initialize() @nameservers = .name_servers end |
Instance Attribute Details
#nameservers ⇒ Object (readonly)
Returns the value of attribute nameservers.
5 6 7 |
# File 'lib/registrar/provider/opensrs/name_server_list.rb', line 5 def nameservers @nameservers end |
Instance Method Details
#to_xml(context) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/registrar/provider/opensrs/name_server_list.rb', line 11 def to_xml(context) context.dt_array do |dt_array| @nameservers.each_with_index do |nameserver, index| dt_array.item(key: index) do |item| item.dt_assoc do |dt_assoc| dt_assoc.item(key: 'sortorder') { |item| item.text! "#{index + 1}" } dt_assoc.item(key: 'name') {|item| item.text! nameserver.name } end end end end end |