Class: ChicagoBusinessLicenses::License
- Inherits:
-
Object
- Object
- ChicagoBusinessLicenses::License
- Defined in:
- lib/chicago_business_licenses.rb
Instance Attribute Summary collapse
-
#account_number ⇒ Object
readonly
Returns the value of attribute account_number.
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#application_created_date ⇒ Object
readonly
Returns the value of attribute application_created_date.
-
#application_requirements_complete ⇒ Object
readonly
Returns the value of attribute application_requirements_complete.
-
#application_type ⇒ Object
readonly
Returns the value of attribute application_type.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#conditional_approval ⇒ Object
readonly
Returns the value of attribute conditional_approval.
-
#date_issued ⇒ Object
readonly
Returns the value of attribute date_issued.
-
#doing_business_as_name ⇒ Object
readonly
Returns the value of attribute doing_business_as_name.
-
#expiration_date ⇒ Object
readonly
Returns the value of attribute expiration_date.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#latitude ⇒ Object
readonly
Returns the value of attribute latitude.
-
#legal_name ⇒ Object
readonly
Returns the value of attribute legal_name.
-
#license_approved_for_issuance ⇒ Object
readonly
Returns the value of attribute license_approved_for_issuance.
-
#license_code ⇒ Object
readonly
Returns the value of attribute license_code.
-
#license_description ⇒ Object
readonly
Returns the value of attribute license_description.
-
#license_id ⇒ Object
readonly
Returns the value of attribute license_id.
-
#license_number ⇒ Object
readonly
Returns the value of attribute license_number.
-
#license_start_date ⇒ Object
readonly
Returns the value of attribute license_start_date.
-
#license_status ⇒ Object
readonly
Returns the value of attribute license_status.
-
#license_status_change_date ⇒ Object
readonly
Returns the value of attribute license_status_change_date.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#longitude ⇒ Object
readonly
Returns the value of attribute longitude.
-
#payment_date ⇒ Object
readonly
Returns the value of attribute payment_date.
-
#police_district ⇒ Object
readonly
Returns the value of attribute police_district.
-
#precinct ⇒ Object
readonly
Returns the value of attribute precinct.
-
#site_number ⇒ Object
readonly
Returns the value of attribute site_number.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#ward ⇒ Object
readonly
Returns the value of attribute ward.
-
#zip_code ⇒ Object
readonly
Returns the value of attribute zip_code.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(license_api_info) ⇒ License
constructor
A new instance of License.
Constructor Details
#initialize(license_api_info) ⇒ License
Returns a new instance of License.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/chicago_business_licenses.rb', line 8 def initialize(license_api_info) @account_number = license_api_info["account_number"] , @address = license_api_info["address"] , @application_created_date = license_api_info["application_created_date"] , @application_requirements_complete = license_api_info["application_requirements_complete"] , @application_type = license_api_info["application_type"] , @city = license_api_info["city"] , @conditional_approval = license_api_info["conditional_approval"] , @date_issued = license_api_info["date_issued"] , @doing_business_as_name = license_api_info["doing_business_as_name"] , @expiration_date = license_api_info["expiration_date"] , @id = license_api_info["id"] , @latitude = license_api_info["latitude"] , @legal_name = license_api_info["legal_name"] , @license_approved_for_issuance = license_api_info["license_approved_for_issuance"] , @license_code = license_api_info["license_code"] , @license_description = license_api_info["license_description"] , @license_id = license_api_info["license_id"] , @license_number = license_api_info["license_number"] , @license_start_date = license_api_info["license_start_date"] , @license_status = license_api_info["license_status"] , @license_status_change_date = license_api_info["license_status_change_date"] , @location = license_api_info["location"], @longitude = license_api_info["longitude"] , @payment_date = license_api_info["payment_date"] , @police_district = license_api_info["police_district"] , @precinct = license_api_info["precinct"] , @site_number = license_api_info["site_number"] , @state = license_api_info["state"] , @ward = license_api_info["ward"] , @zip_code = license_api_info["zip_code"] end |
Instance Attribute Details
#account_number ⇒ Object (readonly)
Returns the value of attribute account_number.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def account_number @account_number end |
#address ⇒ Object (readonly)
Returns the value of attribute address.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def address @address end |
#application_created_date ⇒ Object (readonly)
Returns the value of attribute application_created_date.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def application_created_date @application_created_date end |
#application_requirements_complete ⇒ Object (readonly)
Returns the value of attribute application_requirements_complete.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def application_requirements_complete @application_requirements_complete end |
#application_type ⇒ Object (readonly)
Returns the value of attribute application_type.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def application_type @application_type end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def city @city end |
#conditional_approval ⇒ Object (readonly)
Returns the value of attribute conditional_approval.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def conditional_approval @conditional_approval end |
#date_issued ⇒ Object (readonly)
Returns the value of attribute date_issued.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def date_issued @date_issued end |
#doing_business_as_name ⇒ Object (readonly)
Returns the value of attribute doing_business_as_name.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def doing_business_as_name @doing_business_as_name end |
#expiration_date ⇒ Object (readonly)
Returns the value of attribute expiration_date.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def expiration_date @expiration_date end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def id @id end |
#latitude ⇒ Object (readonly)
Returns the value of attribute latitude.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def latitude @latitude end |
#legal_name ⇒ Object (readonly)
Returns the value of attribute legal_name.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def legal_name @legal_name end |
#license_approved_for_issuance ⇒ Object (readonly)
Returns the value of attribute license_approved_for_issuance.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def license_approved_for_issuance @license_approved_for_issuance end |
#license_code ⇒ Object (readonly)
Returns the value of attribute license_code.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def license_code @license_code end |
#license_description ⇒ Object (readonly)
Returns the value of attribute license_description.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def license_description @license_description end |
#license_id ⇒ Object (readonly)
Returns the value of attribute license_id.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def license_id @license_id end |
#license_number ⇒ Object (readonly)
Returns the value of attribute license_number.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def license_number @license_number end |
#license_start_date ⇒ Object (readonly)
Returns the value of attribute license_start_date.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def license_start_date @license_start_date end |
#license_status ⇒ Object (readonly)
Returns the value of attribute license_status.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def license_status @license_status end |
#license_status_change_date ⇒ Object (readonly)
Returns the value of attribute license_status_change_date.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def license_status_change_date @license_status_change_date end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def location @location end |
#longitude ⇒ Object (readonly)
Returns the value of attribute longitude.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def longitude @longitude end |
#payment_date ⇒ Object (readonly)
Returns the value of attribute payment_date.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def payment_date @payment_date end |
#police_district ⇒ Object (readonly)
Returns the value of attribute police_district.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def police_district @police_district end |
#precinct ⇒ Object (readonly)
Returns the value of attribute precinct.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def precinct @precinct end |
#site_number ⇒ Object (readonly)
Returns the value of attribute site_number.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def site_number @site_number end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def state @state end |
#ward ⇒ Object (readonly)
Returns the value of attribute ward.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def ward @ward end |
#zip_code ⇒ Object (readonly)
Returns the value of attribute zip_code.
6 7 8 |
# File 'lib/chicago_business_licenses.rb', line 6 def zip_code @zip_code end |
Class Method Details
.all ⇒ Object
41 42 43 44 45 |
# File 'lib/chicago_business_licenses.rb', line 41 def self.all api_array = Unirest.get("https://data.cityofchicago.org/resource/xqx5-8hwx.json").body create_licenses(api_array) end |
.search(search_keyword) ⇒ Object
47 48 49 50 51 |
# File 'lib/chicago_business_licenses.rb', line 47 def self.search(search_keyword) api_array = Unirest.get("https://data.cityofchicago.org/resource/xqx5-8hwx.json?$q=#{search_keyword}").body create_licenses(api_array) end |