Class: Crunchbase::Model::Person

Inherits:
Entity
  • Object
show all
Defined in:
lib/crunchbase/model/person.rb

Direct Known Subclasses

Founder

Constant Summary collapse

RESOURCE_LIST =
RESOURCE_NAME = 'people'

Instance Attribute Summary collapse

Attributes inherited from Entity

#type_name, #uuid

Instance Method Summary collapse

Methods inherited from Entity

array_from_list, #fetch, funding_rounds_lists, get, list, organization_lists, parsing_from_list, person_lists, total_items_from_list

Constructor Details

#initialize(json) ⇒ Person



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/crunchbase/model/person.rb', line 21

def initialize(json)
  super

  unless (relationships = json['relationships']).nil?
    set_relationships_object(Crunchbase::Model::PrimaryAffiliation, 'primary_affiliation', relationships['primary_affiliation'])
    set_relationships_object(Crunchbase::Model::PrimaryAffiliation, 'primary_location', relationships['primary_location'])
    set_relationships_object(Crunchbase::Model::PrimaryImage, 'primary_image', relationships['primary_image'])
    set_relationships_object(Crunchbase::Model::Website, 'websites', relationships['websites'])
    set_relationships_object(Crunchbase::Model::Degree, 'degrees', relationships['degrees'])
    set_relationships_object(Crunchbase::Model::Job, 'jobs', relationships['jobs'])
    set_relationships_object(Crunchbase::Model::AdvisoryRole, 'advisory_roles', relationships['advisor_at'])
    set_relationships_object(Crunchbase::Model::FoundedCompany, 'founded_companies', relationships['founded_companies'])
    set_relationships_object(Crunchbase::Model::Investment, 'investments', relationships['investments'])
    set_relationships_object(Crunchbase::Model::Membership, 'memberships', relationships['memberships'])
    set_relationships_object(Crunchbase::Model::Image, 'images', relationships['images'])
    set_relationships_object(Crunchbase::Model::Video, 'videos', relationships['videos'])
    set_relationships_object(Crunchbase::Model::New, 'news', relationships['news'])
  end
end

Instance Attribute Details

#advisory_rolesObject (readonly)

Returns the value of attribute advisory_roles.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def advisory_roles
  @advisory_roles
end

#advisory_roles_total_itemsObject (readonly)

Returns the value of attribute advisory_roles_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def advisory_roles_total_items
  @advisory_roles_total_items
end

#also_known_asObject (readonly)

Returns the value of attribute also_known_as.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def also_known_as
  @also_known_as
end

#api_pathObject (readonly)

Returns the value of attribute api_path.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def api_path
  @api_path
end

#bioObject (readonly)

Returns the value of attribute bio.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def bio
  @bio
end

#born_onObject (readonly)

Returns the value of attribute born_on.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def born_on
  @born_on
end

#born_on_trust_codeObject (readonly)

Returns the value of attribute born_on_trust_code.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def born_on_trust_code
  @born_on_trust_code
end

#created_atObject (readonly)

Returns the value of attribute created_at.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def created_at
  @created_at
end

#degreesObject (readonly)

Returns the value of attribute degrees.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def degrees
  @degrees
end

#degrees_total_itemsObject (readonly)

Returns the value of attribute degrees_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def degrees_total_items
  @degrees_total_items
end

#died_onObject (readonly)

Returns the value of attribute died_on.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def died_on
  @died_on
end

#died_on_trust_codeObject (readonly)

Returns the value of attribute died_on_trust_code.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def died_on_trust_code
  @died_on_trust_code
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def first_name
  @first_name
end

#founded_companiesObject (readonly)

Returns the value of attribute founded_companies.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def founded_companies
  @founded_companies
end

#founded_companies_total_itemsObject (readonly)

Returns the value of attribute founded_companies_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def founded_companies_total_items
  @founded_companies_total_items
end

#imagesObject (readonly)

Returns the value of attribute images.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def images
  @images
end

#images_total_itemsObject (readonly)

Returns the value of attribute images_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def images_total_items
  @images_total_items
end

#investmentsObject (readonly)

Returns the value of attribute investments.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def investments
  @investments
end

#investments_total_itemsObject (readonly)

Returns the value of attribute investments_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def investments_total_items
  @investments_total_items
end

#is_deceasedObject (readonly)

Returns the value of attribute is_deceased.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def is_deceased
  @is_deceased
end

#jobsObject (readonly)

Returns the value of attribute jobs.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def jobs
  @jobs
end

#jobs_total_itemsObject (readonly)

Returns the value of attribute jobs_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def jobs_total_items
  @jobs_total_items
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def last_name
  @last_name
end

#membershipsObject (readonly)

Returns the value of attribute memberships.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def memberships
  @memberships
end

#memberships_total_itemsObject (readonly)

Returns the value of attribute memberships_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def memberships_total_items
  @memberships_total_items
end

#newsObject (readonly)

Returns the value of attribute news.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def news
  @news
end

#news_total_itemsObject (readonly)

Returns the value of attribute news_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def news_total_items
  @news_total_items
end

Returns the value of attribute permalink.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def permalink
  @permalink
end

#primary_affiliationObject (readonly)

Returns the value of attribute primary_affiliation.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def primary_affiliation
  @primary_affiliation
end

#primary_affiliation_total_itemsObject (readonly)

Returns the value of attribute primary_affiliation_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def primary_affiliation_total_items
  @primary_affiliation_total_items
end

#primary_imageObject (readonly)

Returns the value of attribute primary_image.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def primary_image
  @primary_image
end

#primary_image_total_itemsObject (readonly)

Returns the value of attribute primary_image_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def primary_image_total_items
  @primary_image_total_items
end

#primary_locationObject (readonly)

Returns the value of attribute primary_location.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def primary_location
  @primary_location
end

#primary_location_total_itemsObject (readonly)

Returns the value of attribute primary_location_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def primary_location_total_items
  @primary_location_total_items
end

#role_investorObject (readonly)

Returns the value of attribute role_investor.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def role_investor
  @role_investor
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def updated_at
  @updated_at
end

#videosObject (readonly)

Returns the value of attribute videos.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def videos
  @videos
end

#videos_total_itemsObject (readonly)

Returns the value of attribute videos_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def videos_total_items
  @videos_total_items
end

#web_pathObject (readonly)

Returns the value of attribute web_path.



8
9
10
# File 'lib/crunchbase/model/person.rb', line 8

def web_path
  @web_path
end

#websitesObject (readonly)

Returns the value of attribute websites.



12
13
14
# File 'lib/crunchbase/model/person.rb', line 12

def websites
  @websites
end

#websites_total_itemsObject (readonly)

Returns the value of attribute websites_total_items.



15
16
17
# File 'lib/crunchbase/model/person.rb', line 15

def websites_total_items
  @websites_total_items
end

Instance Method Details

#date_keysObject



49
50
51
# File 'lib/crunchbase/model/person.rb', line 49

def date_keys
  %w[ born_on died_on ]
end

#property_keysObject



41
42
43
44
45
46
47
# File 'lib/crunchbase/model/person.rb', line 41

def property_keys
  %w[
    permalink api_path web_path first_name last_name also_known_as bio 
    role_investor born_on born_on_trust_code is_deceased died_on died_on_trust_code 
    created_at updated_at
  ]
end