diff --git a/lib/gus_bir1/response/search.rb b/lib/gus_bir1/response/search.rb index 3835a8a..3dfe196 100644 --- a/lib/gus_bir1/response/search.rb +++ b/lib/gus_bir1/response/search.rb @@ -17,20 +17,22 @@ def array private def parse_dane(hash) - search_result = OpenStruct.new - search_result.name = hash['Nazwa'] - search_result.regon = hash['Regon'] - search_result.province = hash['Wojewodztwo'] - search_result.district = hash['Powiat'] - search_result.community = hash['Gmina'] - search_result.city = hash['Miejscowosc'] - search_result.zip_code = hash['KodPocztowy'] - search_result.street = hash['Ulica'] - search_result.type = hash['Typ'] - search_result.silos_id = hash['SilosID'] - search_result.type_desc = type_info(search_result) - search_result.silos_desc = silos_info(search_result) - search_result.report = report_info(search_result) + search_result = OpenStruct.new + search_result.name = hash['Nazwa'] + search_result.regon = hash['Regon'] + search_result.province = hash['Wojewodztwo'] + search_result.district = hash['Powiat'] + search_result.community = hash['Gmina'] + search_result.city = hash['Miejscowosc'] + search_result.zip_code = hash['KodPocztowy'] + search_result.street = hash['Ulica'] + search_result.property_number = hash['NrNieruchomosci'] + search_result.local_number = hash['NrLokalu'] + search_result.type = hash['Typ'] + search_result.silos_id = hash['SilosID'] + search_result.type_desc = type_info(search_result) + search_result.silos_desc = silos_info(search_result) + search_result.report = report_info(search_result) search_result end diff --git a/test/gus_bir1_test.rb b/test/gus_bir1_test.rb index 6cd5d46..0e7ffcb 100644 --- a/test/gus_bir1_test.rb +++ b/test/gus_bir1_test.rb @@ -20,6 +20,8 @@ def setup city: 'Warszawa', zip_code: '00-925', street: 'ul. Test-Krucza', + property_number: "208", + local_number: nil, type: 'P', silos_id: '6', type_desc: 'Typ jednostki – jednostka prawna', @@ -36,6 +38,8 @@ def setup city: 'Wrocław', zip_code: '53-505', street: 'ul. Test-Krucza', + property_number: "15", + local_number: nil, type: 'P', silos_id: '6', type_desc: 'Typ jednostki – jednostka prawna',