Class: Crunchbase::Product
- Defined in:
- lib/crunchbase/product.rb
Constant Summary collapse
- RESOURCE_NAME =
'product'
- RESOURCE_LIST =
'products'
Constants inherited from CBEntity
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#homepage_url ⇒ Object
readonly
Returns the value of attribute homepage_url.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#images_total_items ⇒ Object
readonly
Returns the value of attribute images_total_items.
-
#launched_on ⇒ Object
readonly
Returns the value of attribute launched_on.
-
#launched_on_trust_code ⇒ Object
readonly
Returns the value of attribute launched_on_trust_code.
-
#lifecycle_stage ⇒ Object
readonly
Returns the value of attribute lifecycle_stage.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#new_items ⇒ Object
readonly
Returns the value of attribute new_items.
-
#new_items_total_items ⇒ Object
readonly
Returns the value of attribute new_items_total_items.
-
#owner_id ⇒ Object
readonly
Returns the value of attribute owner_id.
-
#permalink ⇒ Object
readonly
Returns the value of attribute permalink.
-
#primary_images ⇒ Object
readonly
Returns the value of attribute primary_images.
-
#primary_images_total_items ⇒ Object
readonly
Returns the value of attribute primary_images_total_items.
-
#short_description ⇒ Object
readonly
Returns the value of attribute short_description.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#websites ⇒ Object
readonly
Returns the value of attribute websites.
-
#websites_total_items ⇒ Object
readonly
Returns the value of attribute websites_total_items.
Instance Method Summary collapse
-
#initialize(json) ⇒ Product
constructor
A new instance of Product.
Methods inherited from CBEntity
array_from_list, #fetch, get, list, lists_for_permalink, search, total_items_from_list
Constructor Details
#initialize(json) ⇒ Product
Returns a new instance of Product.
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/crunchbase/product.rb', line 20 def initialize(json) @type_name = json['type'] properties = json['properties'] relationships = json['relationships'] @name = properties['name'] @lifecycle_stage = properties['lifecycle_stage'] @owner_id = properties['owner_id'] @short_description = properties['short_description'] @permalink = properties['permalink'] @homepage_url = properties['homepage_url'] @description = properties['description'] @launched_on = properties['launched_on'] && DateTime.parse(properties['launched_on']) @created_at = Time.at(properties['created_at']).utc @updated_at = Time.at(properties['updated_at']).utc @launched_on_trust_code = properties['launched_on_trust_code'] @primary_images_list = relationships['primary_image'] @images_list = relationships['images'] @websites_list = relationships['websites'] @new_items_list = relationships['news'] end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def description @description end |
#homepage_url ⇒ Object (readonly)
Returns the value of attribute homepage_url.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def homepage_url @homepage_url end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
16 17 18 |
# File 'lib/crunchbase/product.rb', line 16 def images @images end |
#images_total_items ⇒ Object (readonly)
Returns the value of attribute images_total_items.
17 18 19 |
# File 'lib/crunchbase/product.rb', line 17 def images_total_items @images_total_items end |
#launched_on ⇒ Object (readonly)
Returns the value of attribute launched_on.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def launched_on @launched_on end |
#launched_on_trust_code ⇒ Object (readonly)
Returns the value of attribute launched_on_trust_code.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def launched_on_trust_code @launched_on_trust_code end |
#lifecycle_stage ⇒ Object (readonly)
Returns the value of attribute lifecycle_stage.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def lifecycle_stage @lifecycle_stage end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def name @name end |
#new_items ⇒ Object (readonly)
Returns the value of attribute new_items.
16 17 18 |
# File 'lib/crunchbase/product.rb', line 16 def new_items @new_items end |
#new_items_total_items ⇒ Object (readonly)
Returns the value of attribute new_items_total_items.
17 18 19 |
# File 'lib/crunchbase/product.rb', line 17 def new_items_total_items @new_items_total_items end |
#owner_id ⇒ Object (readonly)
Returns the value of attribute owner_id.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def owner_id @owner_id end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def permalink @permalink end |
#primary_images ⇒ Object (readonly)
Returns the value of attribute primary_images.
16 17 18 |
# File 'lib/crunchbase/product.rb', line 16 def primary_images @primary_images end |
#primary_images_total_items ⇒ Object (readonly)
Returns the value of attribute primary_images_total_items.
17 18 19 |
# File 'lib/crunchbase/product.rb', line 17 def primary_images_total_items @primary_images_total_items end |
#short_description ⇒ Object (readonly)
Returns the value of attribute short_description.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def short_description @short_description end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def type_name @type_name end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
12 13 14 |
# File 'lib/crunchbase/product.rb', line 12 def updated_at @updated_at end |
#websites ⇒ Object (readonly)
Returns the value of attribute websites.
16 17 18 |
# File 'lib/crunchbase/product.rb', line 16 def websites @websites end |
#websites_total_items ⇒ Object (readonly)
Returns the value of attribute websites_total_items.
17 18 19 |
# File 'lib/crunchbase/product.rb', line 17 def websites_total_items @websites_total_items end |