Class: Crunchbase::Relationship
- Defined in:
- lib/crunchbase/relationship.rb
Direct Known Subclasses
Constant Summary
Constants inherited from CBEntity
Instance Attribute Summary collapse
-
#announced_on ⇒ Object
readonly
Returns the value of attribute announced_on.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#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(hash) ⇒ Relationship
constructor
A new instance of Relationship.
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(hash) ⇒ Relationship
Returns a new instance of Relationship.
10 11 12 13 14 15 16 17 18 |
# File 'lib/crunchbase/relationship.rb', line 10 def initialize(hash) @type_name = hash["type"] @announced_on = hash["announced_on"] && DateTime.parse(hash["announced_on"]) @name = hash["name"] @path = hash["path"] @permalink = hash["path"] && hash["path"].split("/").last @created_at = hash["created_at"] && (hash["created_at"].kind_of?(String) ? DateTime.parse(hash["created_at"]) : Time.at(hash["created_at"]).utc) @updated_at = hash["updated_at"] && (hash["updated_at"].kind_of?(String) ? DateTime.parse(hash["updated_at"]) : Time.at(hash["updated_at"]).utc) end |
Instance Attribute Details
#announced_on ⇒ Object (readonly)
Returns the value of attribute announced_on.
8 9 10 |
# File 'lib/crunchbase/relationship.rb', line 8 def announced_on @announced_on end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
8 9 10 |
# File 'lib/crunchbase/relationship.rb', line 8 def created_at @created_at end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/crunchbase/relationship.rb', line 8 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/crunchbase/relationship.rb', line 8 def path @path end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
8 9 10 |
# File 'lib/crunchbase/relationship.rb', line 8 def permalink @permalink end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
8 9 10 |
# File 'lib/crunchbase/relationship.rb', line 8 def type_name @type_name end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
8 9 10 |
# File 'lib/crunchbase/relationship.rb', line 8 def updated_at @updated_at end |