Class: Crunchbase::Image
Constant Summary collapse
- RESOURCE_NAME =
'image'
- RESOURCE_LIST =
'images'
Constants inherited from CBEntity
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#original_path ⇒ Object
readonly
Returns the value of attribute original_path.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#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) ⇒ Image
constructor
A new instance of Image.
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(json) ⇒ Image
Returns a new instance of Image.
13 14 15 16 17 18 19 20 |
# File 'lib/crunchbase/image.rb', line 13 def initialize(json) @type_name = json['type'] @title = json['title'] @original_path = json['path'] @path = json['path'] && Crunchbase::API.image_url + json['path'] @created_at = Time.at(json['created_at']).utc @updated_at = Time.at(json['updated_at']).utc end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
11 12 13 |
# File 'lib/crunchbase/image.rb', line 11 def created_at @created_at end |
#original_path ⇒ Object (readonly)
Returns the value of attribute original_path.
11 12 13 |
# File 'lib/crunchbase/image.rb', line 11 def original_path @original_path end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
11 12 13 |
# File 'lib/crunchbase/image.rb', line 11 def path @path end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
11 12 13 |
# File 'lib/crunchbase/image.rb', line 11 def title @title end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
11 12 13 |
# File 'lib/crunchbase/image.rb', line 11 def type_name @type_name end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
11 12 13 |
# File 'lib/crunchbase/image.rb', line 11 def updated_at @updated_at end |