Class: Crunchbase::Person
Constant Summary collapse
- RESOURCE_LIST =
'people'
- RESOURCE_NAME =
'person'
Constants inherited from CBEntity
Instance Attribute Summary collapse
-
#advisor_ats ⇒ Object
readonly
Returns the value of attribute advisor_ats.
-
#advisor_ats_total_items ⇒ Object
readonly
Returns the value of attribute advisor_ats_total_items.
-
#bio ⇒ Object
readonly
Returns the value of attribute bio.
-
#born_on ⇒ Object
readonly
Returns the value of attribute born_on.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#degrees ⇒ Object
readonly
Returns the value of attribute degrees.
-
#degrees_total_items ⇒ Object
readonly
TODO Get all relationships total count.
-
#died_on ⇒ Object
readonly
Returns the value of attribute died_on.
-
#experiences ⇒ Object
readonly
Returns the value of attribute experiences.
-
#experiences_total_items ⇒ Object
readonly
Returns the value of attribute experiences_total_items.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#founded_companies ⇒ Object
readonly
Returns the value of attribute founded_companies.
-
#founded_companies_total_items ⇒ Object
readonly
Returns the value of attribute founded_companies_total_items.
-
#homepage_url ⇒ Object
readonly
Returns the value of attribute homepage_url.
-
#investments ⇒ Object
readonly
Returns the value of attribute investments.
-
#investments_total_items ⇒ Object
readonly
Returns the value of attribute investments_total_items.
-
#is_deceased ⇒ Object
readonly
Returns the value of attribute is_deceased.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#new_items ⇒ Object
readonly
Returns the value of attribute new_items.
-
#new_items_total_items ⇒ Object
readonly
Returns the value of attribute new_items_total_items.
-
#permalink ⇒ Object
readonly
Returns the value of attribute permalink.
-
#primary_affiliations ⇒ Object
readonly
Returns the value of attribute primary_affiliations.
-
#primary_affiliations_total_items ⇒ Object
readonly
Returns the value of attribute primary_affiliations_total_items.
-
#primary_images ⇒ Object
readonly
Returns the value of attribute primary_images.
-
#primary_images_total_items ⇒ Object
readonly
Returns the value of attribute primary_images_total_items.
-
#primary_locations ⇒ Object
readonly
Returns the value of attribute primary_locations.
-
#primary_locations_total_items ⇒ Object
readonly
Returns the value of attribute primary_locations_total_items.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
-
#videos ⇒ Object
readonly
Returns the value of attribute videos.
-
#videos_total_items ⇒ Object
readonly
Returns the value of attribute videos_total_items.
-
#websites ⇒ Object
readonly
Returns the value of attribute websites.
-
#websites_total_items ⇒ Object
readonly
Returns the value of attribute websites_total_items.
Instance Method Summary collapse
- #advisor_ats_total_itmes ⇒ Object
-
#initialize(json) ⇒ Person
constructor
A new instance of Person.
- #investments_total_itmes ⇒ Object
Methods inherited from CBEntity
array_from_list, category_lists_by_permalink, #fetch, get, list, lists_for_permalink, lists_for_person_permalink, parsing_from_list, search, total_items_from_list
Constructor Details
#initialize(json) ⇒ Person
Returns a new instance of Person.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/crunchbase/person.rb', line 23 def initialize(json) @uuid = json['uuid'] @type_name = json['type'] properties = json['properties'] relationships = json['relationships'] @name = properties['first_name'].to_s + ' ' + properties['last_name'].to_s @first_name = properties['first_name'] @last_name = properties['last_name'] @permalink = properties['permalink'] @bio = properties['bio'] @born_on = properties['born_on'] && DateTime.parse(properties['born_on']) @died_on = properties['died_on'] && DateTime.parse(properties['died_on']) @is_deceased = properties['is_deceased'] @homepage_url = properties['homepage_url'] @created_at = Time.at(properties['created_at']).utc @updated_at = Time.at(properties['updated_at']).utc @degrees_list = relationships['degrees'] @experiences_list = relationships['experience'] @primary_locations_list = relationships['primary_location'] @affiliations_list = relationships['primary_affiliation'] @investments_list = relationships['investments'] @advisor_ats_list = relationships['advisor_at'] @founded_companies_list = relationships['founded_companies'] @primary_images_list = relationships['primary_image'] @videos_list = relationships['videos'] @websites_list = relationships['websites'] @new_items_list = relationships['news'] end |
Instance Attribute Details
#advisor_ats ⇒ Object (readonly)
Returns the value of attribute advisor_ats.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def advisor_ats @advisor_ats end |
#advisor_ats_total_items ⇒ Object (readonly)
Returns the value of attribute advisor_ats_total_items.
17 18 19 |
# File 'lib/crunchbase/person.rb', line 17 def advisor_ats_total_items @advisor_ats_total_items end |
#bio ⇒ Object (readonly)
Returns the value of attribute bio.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def bio @bio end |
#born_on ⇒ Object (readonly)
Returns the value of attribute born_on.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def born_on @born_on end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def created_at @created_at end |
#degrees ⇒ Object (readonly)
Returns the value of attribute degrees.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def degrees @degrees end |
#degrees_total_items ⇒ Object (readonly)
TODO Get all relationships total count
101 102 103 |
# File 'lib/crunchbase/person.rb', line 101 def degrees_total_items @degrees_total_items end |
#died_on ⇒ Object (readonly)
Returns the value of attribute died_on.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def died_on @died_on end |
#experiences ⇒ Object (readonly)
Returns the value of attribute experiences.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def experiences @experiences end |
#experiences_total_items ⇒ Object (readonly)
Returns the value of attribute experiences_total_items.
17 18 19 |
# File 'lib/crunchbase/person.rb', line 17 def experiences_total_items @experiences_total_items end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def first_name @first_name end |
#founded_companies ⇒ Object (readonly)
Returns the value of attribute founded_companies.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def founded_companies @founded_companies end |
#founded_companies_total_items ⇒ Object (readonly)
Returns the value of attribute founded_companies_total_items.
17 18 19 |
# File 'lib/crunchbase/person.rb', line 17 def founded_companies_total_items @founded_companies_total_items end |
#homepage_url ⇒ Object (readonly)
Returns the value of attribute homepage_url.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def homepage_url @homepage_url end |
#investments ⇒ Object (readonly)
Returns the value of attribute investments.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def investments @investments end |
#investments_total_items ⇒ Object (readonly)
Returns the value of attribute investments_total_items.
17 18 19 |
# File 'lib/crunchbase/person.rb', line 17 def investments_total_items @investments_total_items end |
#is_deceased ⇒ Object (readonly)
Returns the value of attribute is_deceased.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def is_deceased @is_deceased end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def last_name @last_name end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def name @name end |
#new_items ⇒ Object (readonly)
Returns the value of attribute new_items.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def new_items @new_items end |
#new_items_total_items ⇒ Object (readonly)
Returns the value of attribute new_items_total_items.
17 18 19 |
# File 'lib/crunchbase/person.rb', line 17 def new_items_total_items @new_items_total_items end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def permalink @permalink end |
#primary_affiliations ⇒ Object (readonly)
Returns the value of attribute primary_affiliations.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def primary_affiliations @primary_affiliations end |
#primary_affiliations_total_items ⇒ Object (readonly)
Returns the value of attribute primary_affiliations_total_items.
17 18 19 |
# File 'lib/crunchbase/person.rb', line 17 def primary_affiliations_total_items @primary_affiliations_total_items end |
#primary_images ⇒ Object (readonly)
Returns the value of attribute primary_images.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def primary_images @primary_images end |
#primary_images_total_items ⇒ Object (readonly)
Returns the value of attribute primary_images_total_items.
17 18 19 |
# File 'lib/crunchbase/person.rb', line 17 def primary_images_total_items @primary_images_total_items end |
#primary_locations ⇒ Object (readonly)
Returns the value of attribute primary_locations.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def primary_locations @primary_locations end |
#primary_locations_total_items ⇒ Object (readonly)
Returns the value of attribute primary_locations_total_items.
17 18 19 |
# File 'lib/crunchbase/person.rb', line 17 def primary_locations_total_items @primary_locations_total_items end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def type_name @type_name end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def updated_at @updated_at end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
11 12 13 |
# File 'lib/crunchbase/person.rb', line 11 def uuid @uuid end |
#videos ⇒ Object (readonly)
Returns the value of attribute videos.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def videos @videos end |
#videos_total_items ⇒ Object (readonly)
Returns the value of attribute videos_total_items.
17 18 19 |
# File 'lib/crunchbase/person.rb', line 17 def videos_total_items @videos_total_items end |
#websites ⇒ Object (readonly)
Returns the value of attribute websites.
14 15 16 |
# File 'lib/crunchbase/person.rb', line 14 def websites @websites end |
#websites_total_items ⇒ Object (readonly)
Returns the value of attribute websites_total_items.
17 18 19 |
# File 'lib/crunchbase/person.rb', line 17 def websites_total_items @websites_total_items end |
Instance Method Details
#advisor_ats_total_itmes ⇒ Object
121 122 123 |
# File 'lib/crunchbase/person.rb', line 121 def advisor_ats_total_itmes @advisor_ats_total_itmes ||= AdvisorAt.total_items_from_list(@advisor_ats_list) end |
#investments_total_itmes ⇒ Object
117 118 119 |
# File 'lib/crunchbase/person.rb', line 117 def investments_total_itmes @investments_total_itmes ||= Investment.total_items_from_list(@investments_list) end |