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.
-
#owner_name ⇒ Object
readonly
Returns the value of attribute owner_name.
-
#owner_path ⇒ Object
readonly
Returns the value of attribute owner_path.
-
#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, 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) ⇒ Product
Returns a new instance of Product.
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/crunchbase/product.rb', line 21 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'] # Maybe removed @owner_name = properties['owner_name'] @owner_path = properties['owner_path'] @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.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def created_at @created_at end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def description @description end |
#homepage_url ⇒ Object (readonly)
Returns the value of attribute homepage_url.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def homepage_url @homepage_url end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
17 18 19 |
# File 'lib/crunchbase/product.rb', line 17 def images @images end |
#images_total_items ⇒ Object (readonly)
Returns the value of attribute images_total_items.
18 19 20 |
# File 'lib/crunchbase/product.rb', line 18 def images_total_items @images_total_items end |
#launched_on ⇒ Object (readonly)
Returns the value of attribute launched_on.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def launched_on @launched_on end |
#launched_on_trust_code ⇒ Object (readonly)
Returns the value of attribute launched_on_trust_code.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def launched_on_trust_code @launched_on_trust_code end |
#lifecycle_stage ⇒ Object (readonly)
Returns the value of attribute lifecycle_stage.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def lifecycle_stage @lifecycle_stage end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def name @name end |
#new_items ⇒ Object (readonly)
Returns the value of attribute new_items.
17 18 19 |
# File 'lib/crunchbase/product.rb', line 17 def new_items @new_items end |
#new_items_total_items ⇒ Object (readonly)
Returns the value of attribute new_items_total_items.
18 19 20 |
# File 'lib/crunchbase/product.rb', line 18 def new_items_total_items @new_items_total_items end |
#owner_id ⇒ Object (readonly)
Returns the value of attribute owner_id.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def owner_id @owner_id end |
#owner_name ⇒ Object (readonly)
Returns the value of attribute owner_name.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def owner_name @owner_name end |
#owner_path ⇒ Object (readonly)
Returns the value of attribute owner_path.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def owner_path @owner_path end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def permalink @permalink end |
#primary_images ⇒ Object (readonly)
Returns the value of attribute primary_images.
17 18 19 |
# File 'lib/crunchbase/product.rb', line 17 def primary_images @primary_images end |
#primary_images_total_items ⇒ Object (readonly)
Returns the value of attribute primary_images_total_items.
18 19 20 |
# File 'lib/crunchbase/product.rb', line 18 def primary_images_total_items @primary_images_total_items end |
#short_description ⇒ Object (readonly)
Returns the value of attribute short_description.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def short_description @short_description end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def type_name @type_name end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
13 14 15 |
# File 'lib/crunchbase/product.rb', line 13 def updated_at @updated_at end |
#websites ⇒ Object (readonly)
Returns the value of attribute websites.
17 18 19 |
# File 'lib/crunchbase/product.rb', line 17 def websites @websites end |
#websites_total_items ⇒ Object (readonly)
Returns the value of attribute websites_total_items.
18 19 20 |
# File 'lib/crunchbase/product.rb', line 18 def websites_total_items @websites_total_items end |