mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Refactor domain info request to builder
This commit is contained in:
parent
0349e63ccd
commit
d747d92d2b
2 changed files with 57 additions and 0 deletions
|
@ -124,6 +124,25 @@ module Epp
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
def domain_info_xml(xml_params={})
|
||||
xml_params[:name_value] = xml_params[:name_value] || 'example.ee'
|
||||
xml_params[:name_hosts] = xml_params[:name_hosts] || 'all'
|
||||
|
||||
xml = Builder::XmlMarkup.new
|
||||
|
||||
xml.instruct!(:xml, :standalone => 'no')
|
||||
xml.epp('xmlns' => 'urn:ietf:params:xml:ns:epp-1.0') do
|
||||
xml.command do
|
||||
xml.info do
|
||||
xml.tag!('domain:info', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do
|
||||
xml.tag!('domain:name', xml_params[:name_value], 'hosts' => xml_params[:name_hosts]) if xml_params[:name] != false
|
||||
end
|
||||
end
|
||||
xml.clTRID 'ABC-12345'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
RSpec.configure do |c|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue