Class: Igsearch::Person
- Inherits:
-
Object
- Object
- Igsearch::Person
- Includes:
- HTTParty
- Defined in:
- lib/igsearch/person.rb
Overview
Class Method Summary collapse
- .count(criteria, options = {}) ⇒ Object
- .find(id, options = {}) ⇒ Object
- .hi ⇒ Object
- .search(criteria, options = {}) ⇒ Object
- .search_raw_address(raw_address, options = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(apikey = Igsearch.apikey) ⇒ Person
constructor
BUG/PROBLEM: still need to .to_json to send json…
Constructor Details
#initialize(apikey = Igsearch.apikey) ⇒ Person
BUG/PROBLEM: still need to .to_json to send json…
23 24 25 26 |
# File 'lib/igsearch/person.rb', line 23 def initialize(apikey=Igsearch.apikey) # this changes it for all instances self.class.default_params :apikey => apikey end |
Class Method Details
.count(criteria, options = {}) ⇒ Object
56 57 58 59 60 61 |
# File 'lib/igsearch/person.rb', line 56 def self.count(criteria, ={}) response = post('/count', body: criteria.to_json) return response.parsed_response["MatchCount"] if response.success? handle_error response end |
.find(id, options = {}) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/igsearch/person.rb', line 32 def self.find(id, ={}) response = get("/#{id}", ) return response.parsed_response if response.success? handle_error response end |
.hi ⇒ Object
28 29 30 |
# File 'lib/igsearch/person.rb', line 28 def self.hi return "success #{Igsearch.apikey}" end |
.search(criteria, options = {}) ⇒ Object
40 41 42 43 44 45 |
# File 'lib/igsearch/person.rb', line 40 def self.search(criteria, ={}) response = post('/search', :body => criteria.to_json) return response.parsed_response if response.success? handle_error response end |
.search_raw_address(raw_address, options = {}) ⇒ Object
47 48 49 50 51 52 53 54 |
# File 'lib/igsearch/person.rb', line 47 def self.search_raw_address(raw_address, ={}) p_address = StreetAddress::US.parse(raw_address) return [] if p_address.nil? address = self.render_parsed_address_to_api_format(p_address) self.search(address, ) end |