Class: Crunchbase::Product
- Includes:
- DateMethods
- Defined in:
- lib/crunchbase/product.rb
Constant Summary collapse
- ENT_NAME =
"product"
- ENT_PLURAL =
"products"
Instance Attribute Summary collapse
-
#blog_feed_url ⇒ Object
readonly
Returns the value of attribute blog_feed_url.
-
#blog_url ⇒ Object
readonly
Returns the value of attribute blog_url.
-
#company_name ⇒ Object
readonly
Returns the value of attribute company_name.
-
#company_permalink ⇒ Object
readonly
Returns the value of attribute company_permalink.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#crunchbase_url ⇒ Object
readonly
Returns the value of attribute crunchbase_url.
-
#deadpooled_url ⇒ Object
readonly
Returns the value of attribute deadpooled_url.
-
#external_links ⇒ Object
readonly
Returns the value of attribute external_links.
-
#homepage_url ⇒ Object
readonly
Returns the value of attribute homepage_url.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#invite_share_url ⇒ Object
readonly
Returns the value of attribute invite_share_url.
-
#milestones ⇒ Object
readonly
Returns the value of attribute milestones.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#overview ⇒ Object
readonly
Returns the value of attribute overview.
-
#permalink ⇒ Object
readonly
Returns the value of attribute permalink.
-
#stage_code ⇒ Object
readonly
Returns the value of attribute stage_code.
-
#twitter_username ⇒ Object
readonly
Returns the value of attribute twitter_username.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#video_embeds ⇒ Object
readonly
Returns the value of attribute video_embeds.
Instance Method Summary collapse
-
#company(force_reload = false) ⇒ Object
Lazy-loads the associated Company entity and caches it.
-
#deadpooled ⇒ Object
Returns the date the product was deadpooled, or nil if not provided.
-
#initialize(json) ⇒ Product
constructor
A new instance of Product.
-
#launched ⇒ Object
Returns the date the product was launched, or nil if not provided.
Methods included from DateMethods
Methods inherited from CB_Object
#===, #aliases, all, find, get, #tags
Constructor Details
#initialize(json) ⇒ Product
Returns a new instance of Product.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/crunchbase/product.rb', line 16 def initialize(json) @name = json['name'] @permalink = json['permalink'] @crunchbase_url = json['crunchbase_url'] @homepage_url = json['homepage_url'] @blog_url = json['blog_url'] @blog_feed_url = json['blog_feed_url'] @twitter_username = json['twitter_username'] @stage_code = json['stage_code'] @deadpooled_url = json['deadpooled_url'] @invite_share_url = json['invite_share_url'] @tag_list = json['tag_list'] @alias_list = json['alias_list'] @deadpooled_year = json['deadpooled_year'] @deadpooled_month = json['deadpooled_month'] @deadpooled_day = json['deadpooled_day'] @launched_year = json['launched_year'] @launched_month = json['launched_month'] @launched_day = json['launched_day'] @created_at = DateTime.parse(json['created_at']) @updated_at = DateTime.parse(json['updated_at']) @overview = json['overview'] @image = json['image'] @company_permalink = json['company']['permalink'] @company_name = json['company']['name'] @milestones = json['milestones'] @video_embeds = json['video_embeds'] @external_links = json['external_links'] end |
Instance Attribute Details
#blog_feed_url ⇒ Object (readonly)
Returns the value of attribute blog_feed_url.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def blog_feed_url @blog_feed_url end |
#blog_url ⇒ Object (readonly)
Returns the value of attribute blog_url.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def blog_url @blog_url end |
#company_name ⇒ Object (readonly)
Returns the value of attribute company_name.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def company_name @company_name end |
#company_permalink ⇒ Object (readonly)
Returns the value of attribute company_permalink.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def company_permalink @company_permalink end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def created_at @created_at end |
#crunchbase_url ⇒ Object (readonly)
Returns the value of attribute crunchbase_url.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def crunchbase_url @crunchbase_url end |
#deadpooled_url ⇒ Object (readonly)
Returns the value of attribute deadpooled_url.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def deadpooled_url @deadpooled_url end |
#external_links ⇒ Object (readonly)
Returns the value of attribute external_links.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def external_links @external_links end |
#homepage_url ⇒ Object (readonly)
Returns the value of attribute homepage_url.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def homepage_url @homepage_url end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def image @image end |
#invite_share_url ⇒ Object (readonly)
Returns the value of attribute invite_share_url.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def invite_share_url @invite_share_url end |
#milestones ⇒ Object (readonly)
Returns the value of attribute milestones.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def milestones @milestones end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def name @name end |
#overview ⇒ Object (readonly)
Returns the value of attribute overview.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def overview @overview end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def permalink @permalink end |
#stage_code ⇒ Object (readonly)
Returns the value of attribute stage_code.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def stage_code @stage_code end |
#twitter_username ⇒ Object (readonly)
Returns the value of attribute twitter_username.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def twitter_username @twitter_username end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def updated_at @updated_at end |
#video_embeds ⇒ Object (readonly)
Returns the value of attribute video_embeds.
10 11 12 |
# File 'lib/crunchbase/product.rb', line 10 def @video_embeds end |
Instance Method Details
#company(force_reload = false) ⇒ Object
Lazy-loads the associated Company entity and caches it. Pass true to force reload.
58 59 60 61 62 |
# File 'lib/crunchbase/product.rb', line 58 def company(force_reload = false) return @company unless @company.nil? or force_reload @company = Company.get(@company_permalink) return @company end |
#deadpooled ⇒ Object
Returns the date the product was deadpooled, or nil if not provided.
47 48 49 |
# File 'lib/crunchbase/product.rb', line 47 def deadpooled @deadpooled ||= date_from_components(@deadpooled_year, @deadpooled_month, @deadpooled_day) end |
#launched ⇒ Object
Returns the date the product was launched, or nil if not provided.
52 53 54 |
# File 'lib/crunchbase/product.rb', line 52 def launched @launched ||= date_from_components(@launched_year, @launched_month, @launched_day) end |