Class: Crunchbase::Model::Product

Inherits:
Entity
  • Object
show all
Defined in:
lib/crunchbase/model/product.rb

Constant Summary collapse

RESOURCE_LIST =
RESOURCE_NAME = 'products'

Instance Attribute Summary collapse

Attributes inherited from Entity

#type_name, #uuid

Instance Method Summary collapse

Methods inherited from Entity

array_from_list, #fetch, funding_rounds_lists, get, list, organization_lists, parsing_from_list, person_lists, total_items_from_list

Constructor Details

#initialize(json) ⇒ Product

attr_reader :owner_total_items, :competitors_total_items, :customers_total_items



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/crunchbase/model/product.rb', line 21

def initialize(json)
  super

  unless (relationships = json['relationships']).nil?
    set_relationships_object(Crunchbase::Model::Category, 'categories', relationships['categories'])
    set_relationships_object(Crunchbase::Model::PrimaryImage, 'primary_image', relationships['primary_image'])
    set_relationships_object(Crunchbase::Model::Image, 'images', relationships['images'])
    set_relationships_object(Crunchbase::Model::Video, 'video', relationships['video'])
    set_relationships_object(Crunchbase::Model::New, 'news', relationships['news'])
  end
end

Instance Attribute Details

#also_known_asObject (readonly)

Returns the value of attribute also_known_as.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def also_known_as
  @also_known_as
end

#api_pathObject (readonly)

Returns the value of attribute api_path.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def api_path
  @api_path
end

#categoriesObject (readonly)

Returns the value of attribute categories.



13
14
15
# File 'lib/crunchbase/model/product.rb', line 13

def categories
  @categories
end

#categories_itemsObject (readonly)

Returns the value of attribute categories_items.



15
16
17
# File 'lib/crunchbase/model/product.rb', line 15

def categories_items
  @categories_items
end

#closed_onObject (readonly)

Returns the value of attribute closed_on.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def closed_on
  @closed_on
end

#closed_on_trust_codeObject (readonly)

Returns the value of attribute closed_on_trust_code.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def closed_on_trust_code
  @closed_on_trust_code
end

#created_atObject (readonly)

Returns the value of attribute created_at.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def created_at
  @created_at
end

#descriptionObject (readonly)

Returns the value of attribute description.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def description
  @description
end

#homepage_urlObject (readonly)

Returns the value of attribute homepage_url.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def homepage_url
  @homepage_url
end

#imagesObject (readonly)

Returns the value of attribute images.



13
14
15
# File 'lib/crunchbase/model/product.rb', line 13

def images
  @images
end

#images_total_itemsObject (readonly)

Returns the value of attribute images_total_items.



13
14
15
# File 'lib/crunchbase/model/product.rb', line 13

def images_total_items
  @images_total_items
end

#launched_onObject (readonly)

Returns the value of attribute launched_on.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def launched_on
  @launched_on
end

#launched_on_trust_codeObject (readonly)

Returns the value of attribute launched_on_trust_code.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def launched_on_trust_code
  @launched_on_trust_code
end

#lifecycle_stageObject (readonly)

Returns the value of attribute lifecycle_stage.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def lifecycle_stage
  @lifecycle_stage
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def name
  @name
end

#new_total_itemsObject (readonly)

Returns the value of attribute new_total_items.



15
16
17
# File 'lib/crunchbase/model/product.rb', line 15

def new_total_items
  @new_total_items
end

#newsObject (readonly)

Returns the value of attribute news.



13
14
15
# File 'lib/crunchbase/model/product.rb', line 13

def news
  @news
end

Returns the value of attribute permalink.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def permalink
  @permalink
end

#primary_imageObject (readonly)

Returns the value of attribute primary_image.



13
14
15
# File 'lib/crunchbase/model/product.rb', line 13

def primary_image
  @primary_image
end

#primary_image_total_itemsObject (readonly)

Returns the value of attribute primary_image_total_items.



15
16
17
# File 'lib/crunchbase/model/product.rb', line 15

def primary_image_total_items
  @primary_image_total_items
end

#short_descriptionObject (readonly)

Returns the value of attribute short_description.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def short_description
  @short_description
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def updated_at
  @updated_at
end

#videoObject (readonly)

Returns the value of attribute video.



13
14
15
# File 'lib/crunchbase/model/product.rb', line 13

def video
  @video
end

#video_total_itemsObject (readonly)

Returns the value of attribute video_total_items.



15
16
17
# File 'lib/crunchbase/model/product.rb', line 15

def video_total_items
  @video_total_items
end

#web_pathObject (readonly)

Returns the value of attribute web_path.



8
9
10
# File 'lib/crunchbase/model/product.rb', line 8

def web_path
  @web_path
end

#websitesObject (readonly)

Returns the value of attribute websites.



13
14
15
# File 'lib/crunchbase/model/product.rb', line 13

def websites
  @websites
end

#websites_total_itemsObject (readonly)

Returns the value of attribute websites_total_items.



15
16
17
# File 'lib/crunchbase/model/product.rb', line 15

def websites_total_items
  @websites_total_items
end

Instance Method Details

#date_keysObject



42
43
44
# File 'lib/crunchbase/model/product.rb', line 42

def date_keys
  %w[launched_on closed_on]
end

#property_keysObject



33
34
35
36
37
38
39
40
# File 'lib/crunchbase/model/product.rb', line 33

def property_keys
  %w[
    permalink api_path web_path name also_known_as 
    lifecycle_stage short_description description 
    launched_on launched_on_trust_code closed_on closed_on_trust_code 
    homepage_url created_at updated_at
  ]
end