Class: RailsWhitepages::WhitePages

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_whitepages.rb

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ WhitePages

Returns a new instance of WhitePages.



12
13
14
15
16
# File 'lib/rails_whitepages.rb', line 12

def initialize(api_key)
  @api_version = "2.1"
  @api_key = api_key
  @base_uri = "https://proapi.whitepages.com/"
end

Instance Method Details

#email_validation(email) ⇒ Object



27
28
29
30
31
# File 'lib/rails_whitepages.rb', line 27

def email_validation(email)
  query = Hash.new
  query["email_address"] = email
  make_http_call(query, "identity_score/email_address_", "2.0")
end

#find_business(name, city) ⇒ Object



37
38
39
40
41
42
# File 'lib/rails_whitepages.rb', line 37

def find_business(name,city)
  query = Hash.new
  query["name"] = name
  query["city"] = city
  make_http_call(query, "business.json")
end

#find_person(query) ⇒ Object



18
19
20
# File 'lib/rails_whitepages.rb', line 18

def find_person(query)
  make_http_call(query, "person.json")
end

#reverse_address(query) ⇒ Object



33
34
35
# File 'lib/rails_whitepages.rb', line 33

def reverse_address(query)
  make_http_call(query, "location.json")
end

#reverse_phone(phone) ⇒ Object



22
23
24
25
# File 'lib/rails_whitepages.rb', line 22

def reverse_phone(phone)
  query["phone_number"] = phone
  make_http_call(query, "phone.json")
end