Class: Puzzle::Contact
- Inherits:
-
Object
- Object
- Puzzle::Contact
- Defined in:
- lib/puzzle/contact.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#area_code ⇒ Object
Returns the value of attribute area_code.
-
#city ⇒ Object
Returns the value of attribute city.
-
#company_id ⇒ Object
Returns the value of attribute company_id.
-
#company_name ⇒ Object
Returns the value of attribute company_name.
-
#country ⇒ Object
Returns the value of attribute country.
-
#email ⇒ Object
Returns the value of attribute email.
-
#firstname ⇒ Object
Returns the value of attribute firstname.
-
#graveyard_status ⇒ Object
Returns the value of attribute graveyard_status.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lastname ⇒ Object
Returns the value of attribute lastname.
-
#owned ⇒ Object
Returns the value of attribute owned.
-
#owned_type ⇒ Object
Returns the value of attribute owned_type.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#state ⇒ Object
Returns the value of attribute state.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
-
#url ⇒ Object
Returns the value of attribute url.
-
#zip ⇒ Object
Returns the value of attribute zip.
Class Method Summary collapse
-
.find(options) ⇒ Object
Return a list of contacts => pageSize: The attribute specifies the maximum number of records to be returned in a request.
Instance Method Summary collapse
-
#initialize(contact_info) ⇒ Contact
constructor
A new instance of Contact.
Constructor Details
#initialize(contact_info) ⇒ Contact
Returns a new instance of Contact.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/puzzle/contact.rb', line 24 def initialize(contact_info) @company_id = contact_info["companyId"] @id = contact_info["contactId"] @title = contact_info["title"] @company_name = contact_info["companyName"] @updated_at = contact_info["updatedDate"] @graveyard_status = contact_info["graveyardStatus"] @firstname = contact_info["firstname"] @lastname = contact_info["lastname"] @city = contact_info["city"] @state = contact_info["state"] @country = contact_info["country"] @zip = contact_info["zip"] @url = contact_info["contactURL"] @area_code = contact_info["areaCode"] @phone = contact_info["phone"] @email = contact_info["email"] @address = contact_info["address"] @owned = contact_info["owned"] @owned_type = contact_info["ownedType"] end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
19 20 21 |
# File 'lib/puzzle/contact.rb', line 19 def address @address end |
#area_code ⇒ Object
Returns the value of attribute area_code.
16 17 18 |
# File 'lib/puzzle/contact.rb', line 16 def area_code @area_code end |
#city ⇒ Object
Returns the value of attribute city.
11 12 13 |
# File 'lib/puzzle/contact.rb', line 11 def city @city end |
#company_id ⇒ Object
Returns the value of attribute company_id.
3 4 5 |
# File 'lib/puzzle/contact.rb', line 3 def company_id @company_id end |
#company_name ⇒ Object
Returns the value of attribute company_name.
6 7 8 |
# File 'lib/puzzle/contact.rb', line 6 def company_name @company_name end |
#country ⇒ Object
Returns the value of attribute country.
13 14 15 |
# File 'lib/puzzle/contact.rb', line 13 def country @country end |
#email ⇒ Object
Returns the value of attribute email.
18 19 20 |
# File 'lib/puzzle/contact.rb', line 18 def email @email end |
#firstname ⇒ Object
Returns the value of attribute firstname.
9 10 11 |
# File 'lib/puzzle/contact.rb', line 9 def firstname @firstname end |
#graveyard_status ⇒ Object
Returns the value of attribute graveyard_status.
8 9 10 |
# File 'lib/puzzle/contact.rb', line 8 def graveyard_status @graveyard_status end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/puzzle/contact.rb', line 4 def id @id end |
#lastname ⇒ Object
Returns the value of attribute lastname.
10 11 12 |
# File 'lib/puzzle/contact.rb', line 10 def lastname @lastname end |
#owned ⇒ Object
Returns the value of attribute owned.
20 21 22 |
# File 'lib/puzzle/contact.rb', line 20 def owned @owned end |
#owned_type ⇒ Object
Returns the value of attribute owned_type.
21 22 23 |
# File 'lib/puzzle/contact.rb', line 21 def owned_type @owned_type end |
#phone ⇒ Object
Returns the value of attribute phone.
17 18 19 |
# File 'lib/puzzle/contact.rb', line 17 def phone @phone end |
#state ⇒ Object
Returns the value of attribute state.
12 13 14 |
# File 'lib/puzzle/contact.rb', line 12 def state @state end |
#title ⇒ Object
Returns the value of attribute title.
5 6 7 |
# File 'lib/puzzle/contact.rb', line 5 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
7 8 9 |
# File 'lib/puzzle/contact.rb', line 7 def updated_at @updated_at end |
#url ⇒ Object
Returns the value of attribute url.
15 16 17 |
# File 'lib/puzzle/contact.rb', line 15 def url @url end |
#zip ⇒ Object
Returns the value of attribute zip.
14 15 16 |
# File 'lib/puzzle/contact.rb', line 14 def zip @zip end |
Class Method Details
.find(options) ⇒ Object
Return a list of contacts
> pageSize: The attribute specifies the maximum number of records to be returned in a request. The system limit and default value is 500.
> firstname: firstname of the contact to be searched
> lastname: last (or family) name of the contact to be searched
> levels: employee rank (e.g. VP, Staff)
> companyName: company for whom contact works (indexed to include Company Name, URL, and ticker symbol)
> email: full email address of the contact to be searched
> View developer.jigsaw.com/documentation/search_and_get_api_guide/6_Data_Keys_and_Values for available search parameter
54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/puzzle/contact.rb', line 54 def self.find() contacts = [] results = {} result = Puzzle::Request.get("/searchContact", ) result["contacts"].each do |contact| contacts << new(contact) end results = { :total => result["totalHits"], :contacts => contacts } end |