Class: Crunchbase::Person
- Includes:
- DateMethods
- Defined in:
- lib/crunchbase/person.rb
Constant Summary collapse
- ENT_NAME =
"person"
- ENT_PLURAL =
"people"
Instance Attribute Summary collapse
-
#affiliation_name ⇒ Object
readonly
Returns the value of attribute affiliation_name.
-
#birthplace ⇒ Object
readonly
Returns the value of attribute birthplace.
-
#blog_feed_url ⇒ Object
readonly
Returns the value of attribute blog_feed_url.
-
#blog_url ⇒ Object
readonly
Returns the value of attribute blog_url.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#crunchbase_url ⇒ Object
readonly
Returns the value of attribute crunchbase_url.
-
#external_links ⇒ Object
readonly
Returns the value of attribute external_links.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#homepage_url ⇒ Object
readonly
Returns the value of attribute homepage_url.
-
#investments ⇒ Object
readonly
Returns the value of attribute investments.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#milestones ⇒ Object
readonly
Returns the value of attribute milestones.
-
#overview ⇒ Object
readonly
Returns the value of attribute overview.
-
#permalink ⇒ Object
readonly
Returns the value of attribute permalink.
-
#relationships ⇒ Object
readonly
Returns the value of attribute relationships.
-
#twitter_username ⇒ Object
readonly
Returns the value of attribute twitter_username.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#video_embeds ⇒ Object
readonly
Returns the value of attribute video_embeds.
-
#web_presences ⇒ Object
readonly
Returns the value of attribute web_presences.
Class Method Summary collapse
Instance Method Summary collapse
-
#born ⇒ Object
Returns a date object, or nil if Date cannot be created from provided information.
-
#initialize(json) ⇒ Person
constructor
A new instance of Person.
Methods included from DateMethods
Methods inherited from CB_Object
#===, #aliases, all, get, #tags
Constructor Details
#initialize(json) ⇒ Person
Returns a new instance of Person.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/crunchbase/person.rb', line 20 def initialize(json) @first_name = json["first_name"] @last_name = json["last_name"] @permalink = json["permalink"] @crunchbase_url = json["crunchbase_url"] @homepage_url = json["homepage_url"] @birthplace = json["birthplace"] @twitter_username = json["twitter_username"] @blog_url = json["blog_url"] @blog_feed_url = json["blog_feed_url"] @affiliation_name = json["affiliation_name"] @born_year = json["born_year"] @born_month = json["born_month"] @born_day = json["born_day"] @tag_list = json["tag_list"] @alias_list = json["alias_list"] @created_at = DateTime.parse(json["created_at"]) @updated_at = DateTime.parse(json["updated_at"]) @overview = json["overview"] @relationships = Relationship.array_from_relationship_list(json["relationships"]) if json["relationships"] @investments = Investment.array_from_investment_list(json["investments"]) if json["investments"] @milestones = json["milestones"] @video_embeds = json["video_embeds"] @external_links = json["external_links"] @web_presences = json["web_presences"] end |
Instance Attribute Details
#affiliation_name ⇒ Object (readonly)
Returns the value of attribute affiliation_name.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def affiliation_name @affiliation_name end |
#birthplace ⇒ Object (readonly)
Returns the value of attribute birthplace.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def birthplace @birthplace end |
#blog_feed_url ⇒ Object (readonly)
Returns the value of attribute blog_feed_url.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def blog_feed_url @blog_feed_url end |
#blog_url ⇒ Object (readonly)
Returns the value of attribute blog_url.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def blog_url @blog_url end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def created_at @created_at end |
#crunchbase_url ⇒ Object (readonly)
Returns the value of attribute crunchbase_url.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def crunchbase_url @crunchbase_url end |
#external_links ⇒ Object (readonly)
Returns the value of attribute external_links.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def external_links @external_links end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def first_name @first_name end |
#homepage_url ⇒ Object (readonly)
Returns the value of attribute homepage_url.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def homepage_url @homepage_url end |
#investments ⇒ Object (readonly)
Returns the value of attribute investments.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def investments @investments end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def last_name @last_name end |
#milestones ⇒ Object (readonly)
Returns the value of attribute milestones.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def milestones @milestones end |
#overview ⇒ Object (readonly)
Returns the value of attribute overview.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def overview @overview end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def permalink @permalink end |
#relationships ⇒ Object (readonly)
Returns the value of attribute relationships.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def relationships @relationships end |
#twitter_username ⇒ Object (readonly)
Returns the value of attribute twitter_username.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def twitter_username @twitter_username end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def updated_at @updated_at end |
#video_embeds ⇒ Object (readonly)
Returns the value of attribute video_embeds.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def @video_embeds end |
#web_presences ⇒ Object (readonly)
Returns the value of attribute web_presences.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def web_presences @web_presences end |
Class Method Details
.find(first_name, last_name) ⇒ Object
16 17 18 |
# File 'lib/crunchbase/person.rb', line 16 def self.find(first_name, last_name) get(API.permalink({first_name: first_name, last_name: last_name}, "people")["permalink"]) end |
Instance Method Details
#born ⇒ Object
Returns a date object, or nil if Date cannot be created from provided information.
50 51 52 |
# File 'lib/crunchbase/person.rb', line 50 def born @born ||= date_from_components(@born_year, @born_month, @born_day) end |