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, #fetch, get, list, lists_for_permalink, search, total_items_from_list
Constructor Details
#initialize(hash) ⇒ Relationship
Returns a new instance of Relationship.
9 10 11 12 13 14 15 16 17 |
# File 'lib/crunchbase/relationship.rb', line 9 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'] && Time.at(hash['created_at']).utc @updated_at = hash['updated_at'] && Time.at(hash['updated_at']).utc end |
Instance Attribute Details
#announced_on ⇒ Object (readonly)
Returns the value of attribute announced_on.
7 8 9 |
# File 'lib/crunchbase/relationship.rb', line 7 def announced_on @announced_on end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/crunchbase/relationship.rb', line 7 def created_at @created_at end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/crunchbase/relationship.rb', line 7 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/crunchbase/relationship.rb', line 7 def path @path end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
7 8 9 |
# File 'lib/crunchbase/relationship.rb', line 7 def permalink @permalink end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
7 8 9 |
# File 'lib/crunchbase/relationship.rb', line 7 def type_name @type_name end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
7 8 9 |
# File 'lib/crunchbase/relationship.rb', line 7 def updated_at @updated_at end |