Class: Lookup::ZiptasticLookup
- Inherits:
-
Base
- Object
- Base
- Lookup::ZiptasticLookup
show all
- Defined in:
- lib/lookup/ziptastic_lookup.rb
Instance Attribute Summary
Attributes inherited from Base
#geo_obj, #response, #response_obj, #zipcode
Instance Method Summary
collapse
Methods inherited from Base
#api_request, #initialize, #parsed_url, process
Constructor Details
This class inherits a constructor from Lookup::Base
Instance Method Details
#build_geo_details ⇒ Object
19
20
21
|
# File 'lib/lookup/ziptastic_lookup.rb', line 19
def build_geo_details
OpenStruct.new(response)
end
|
#fetch_response ⇒ Object
15
16
17
|
# File 'lib/lookup/ziptastic_lookup.rb', line 15
def fetch_response
self.response = JSON.parse(response)
end
|
#process ⇒ Object
9
10
11
12
13
|
# File 'lib/lookup/ziptastic_lookup.rb', line 9
def process
super
fetch_response
build_geo_details
end
|
#search_url ⇒ Object
5
6
7
|
# File 'lib/lookup/ziptastic_lookup.rb', line 5
def search_url
"http://ziptasticapi.com/#{zipcode}"
end
|