Class: CompaniesHouse::CompanyInformation
- Defined in:
- lib/companies_house/company_information.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #company_profile(company_number) ⇒ Object
-
#initialize ⇒ CompanyInformation
constructor
A new instance of CompanyInformation.
- #registered_office_address(company_number) ⇒ Object
Constructor Details
#initialize ⇒ CompanyInformation
Returns a new instance of CompanyInformation.
5 6 7 |
# File 'lib/companies_house/company_information.rb', line 5 def initialize super end |
Instance Method Details
#company_profile(company_number) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/companies_house/company_information.rb', line 9 def company_profile(company_number) # GET /company/company_number url = "company/#{company_number}" response = @@conn.get url result = JSON.parse(response.body, object_class: OpenStruct) if result.respond_to?(:errors) if result.errors[0][:error] == "company-profile-not-found" raise CompanyNotFoundError.new("A company with that registration number could not be found") end else return result end end |
#registered_office_address(company_number) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/companies_house/company_information.rb', line 23 def registered_office_address(company_number) # GET /company/company_number/registered-office-address url = "company/#{company_number}/registered-office-address" response = @@conn.get url result = JSON.parse(response.body, object_class: OpenStruct) if result.respond_to?(:errors) if result.errors[0][:error] == "company-profile-not-found" raise CompanyNotFoundError.new("A company with that registration number could not be found") end else return result end end |