Class: Crunchbase::Person
Constant Summary collapse
- RESOURCE_NAME =
'person'
- RESOURCE_LIST =
'people'
Constants inherited from CBEntity
Instance Attribute Summary collapse
-
#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.
-
#died_on ⇒ Object
readonly
Returns the value of attribute died_on.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#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.
-
#permalink ⇒ Object
readonly
Returns the value of attribute permalink.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(json) ⇒ Person
constructor
A new instance of Person.
Methods inherited from CBEntity
array_from_list, #fetch, get, list, lists_for_permalink, search, total_items_from_list
Constructor Details
#initialize(json) ⇒ Person
Returns a new instance of Person.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/crunchbase/person.rb', line 13 def initialize(json) @type_name = json['type'] properties = json['properties'] @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'] @created_at = Time.at(properties['created_at']).utc @updated_at = Time.at(properties['updated_at']).utc end |
Instance Attribute Details
#bio ⇒ Object (readonly)
Returns the value of attribute bio.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def bio @bio end |
#born_on ⇒ Object (readonly)
Returns the value of attribute born_on.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def born_on @born_on 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 |
#died_on ⇒ Object (readonly)
Returns the value of attribute died_on.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def died_on @died_on 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 |
#is_deceased ⇒ Object (readonly)
Returns the value of attribute is_deceased.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def is_deceased @is_deceased 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 |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def name @name end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def permalink @permalink end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
10 11 12 |
# File 'lib/crunchbase/person.rb', line 10 def type_name @type_name 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 |