Class: CompaniesHouseInputGateway::Forms::FormSubmission
Instance Attribute Summary
#data, #xml
Instance Method Summary
collapse
#generate_xml_from_incoming_data, #initialize
Instance Method Details
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/companies_house_input_gateway/forms/form_submission.rb', line 6
def build_form(request_type, requested_form = nil)
FormValidator.validate(data, Util.demodulize(self.class))
xml.FormSubmission(submission_namespace) do
(xml, request_type, data)
xml.DateSigned data[:date_signed] xml.Form do
requested_form.build_form(request_type, xml)
end
end
end
|
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/companies_house_input_gateway/forms/form_submission.rb', line 27
def (root_xml, request_type, data)
root_xml.FormHeader do
root_xml.CompanyNumber data[:company_number]
root_xml.CompanyName data[:company_name]
root_xml.CompanyAuthenticationCode data[:company_authentication_code]
root_xml.PackageReference data[:package_reference]
root_xml.FormIdentifier Util.camelize(request_type)
root_xml.SubmissionNumber data[:submission_number]
end
end
|
#submission_namespace ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'lib/companies_house_input_gateway/forms/form_submission.rb', line 18
def submission_namespace
{
'xmlns' => 'http://xmlgw.companieshouse.gov.uk/Header',
'xmlns:bs' => 'http://xmlgw.companieshouse.gov.uk',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:schemaLocation' => 'http://xmlgw.companieshouse.gov.uk/Header http://xmlgw.companieshouse.gov.uk/v1-0/schema/forms/FormSubmission-v2-9.xsd'
}
end
|