Class: Crunchbase::Company
- Includes:
- DateMethods
- Defined in:
- lib/crunchbase/company.rb
Overview
Represents a Company listed in the Crunchbase.
Constant Summary collapse
- ENT_NAME =
"company"
- ENT_PLURAL =
"companies"
Instance Attribute Summary collapse
-
#acquisition ⇒ Object
readonly
Returns the value of attribute acquisition.
-
#acquisitions ⇒ Object
readonly
Returns the value of attribute acquisitions.
-
#blog_feed_url ⇒ Object
readonly
Returns the value of attribute blog_feed_url.
-
#blog_url ⇒ Object
readonly
Returns the value of attribute blog_url.
-
#category_code ⇒ Object
readonly
Returns the value of attribute category_code.
-
#competitions ⇒ Object
readonly
Returns the value of attribute competitions.
-
#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.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#email_address ⇒ Object
readonly
Returns the value of attribute email_address.
-
#external_links ⇒ Object
readonly
Returns the value of attribute external_links.
-
#funding_rounds ⇒ Object
readonly
Returns the value of attribute funding_rounds.
-
#homepage_url ⇒ Object
readonly
Returns the value of attribute homepage_url.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#investments ⇒ Object
readonly
Returns the value of attribute investments.
-
#ipo ⇒ Object
readonly
Returns the value of attribute ipo.
-
#milestones ⇒ Object
readonly
Returns the value of attribute milestones.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number_of_employees ⇒ Object
readonly
Returns the value of attribute number_of_employees.
-
#offices ⇒ Object
readonly
Returns the value of attribute offices.
-
#overview ⇒ Object
readonly
Returns the value of attribute overview.
-
#permalink ⇒ Object
readonly
Returns the value of attribute permalink.
-
#phone_number ⇒ Object
readonly
Returns the value of attribute phone_number.
-
#providerships ⇒ Object
readonly
Returns the value of attribute providerships.
-
#relationships ⇒ Object
readonly
Returns the value of attribute relationships.
-
#screenshots ⇒ Object
readonly
Returns the value of attribute screenshots.
-
#total_money_raised ⇒ Object
readonly
Returns the value of attribute total_money_raised.
-
#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
-
#deadpooled ⇒ Object
Returns the date the company was deadpooled, or nil if not provided.
-
#founded ⇒ Object
Returns the date the company was founded, or nil if not provided.
-
#initialize(json) ⇒ Company
constructor
A new instance of Company.
-
#products ⇒ Object
Returns an array of Product objects, representing this Company’s products.
Methods included from DateMethods
Methods inherited from CB_Object
#===, #aliases, all, find, get, #tags
Constructor Details
#initialize(json) ⇒ Company
Returns a new instance of Company.
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 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/crunchbase/company.rb', line 19 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"] @category_code = json["category_code"] @number_of_employees = json["number_of_employees"] @founded_year = json["founded_year"] @founded_month = json["founded_month"] @founded_day = json["founded_day"] @deadpooled_year = json["deadpooled_year"] @deadpooled_month = json["deadpooled_month"] @deadpooled_day = json["deadpooled_day"] @deadpooled_url = json["deadpooled_url"] @tag_list = json["tag_list"] @alias_list = json["alias_list"] @email_address = json["email_address"] @phone_number = json["phone_number"] @description = json["description"] @created_at = DateTime.parse(json["created_at"]) @updated_at = DateTime.parse(json["updated_at"]) @overview = json["overview"] @image = json["image"] @products_list = json["products"] @relationships = Relationship.array_from_relationship_list(json["relationships"]) if json["relationships"] @competitions = json["competitions"] @providerships = Relationship.array_from_relationship_list(json["providerships"]) if json["providerships"] @total_money_raised = json["total_money_raised"] @funding_rounds = json["funding_rounds"] @investments = Investment.array_from_investment_list(json['investments']) if json['investments'] @acquisition = json["acquisition"] @acquisitions = json["acquisitions"] @offices = json["offices"] @milestones = json["milestones"] @ipo = json["ipo"] @video_embeds = json["video_embeds"] @screenshots = json["screenshots"] @external_links = json["external_links"] end |
Instance Attribute Details
#acquisition ⇒ Object (readonly)
Returns the value of attribute acquisition.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def acquisition @acquisition end |
#acquisitions ⇒ Object (readonly)
Returns the value of attribute acquisitions.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def acquisitions @acquisitions end |
#blog_feed_url ⇒ Object (readonly)
Returns the value of attribute blog_feed_url.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def blog_feed_url @blog_feed_url end |
#blog_url ⇒ Object (readonly)
Returns the value of attribute blog_url.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def blog_url @blog_url end |
#category_code ⇒ Object (readonly)
Returns the value of attribute category_code.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def category_code @category_code end |
#competitions ⇒ Object (readonly)
Returns the value of attribute competitions.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def competitions @competitions end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def created_at @created_at end |
#crunchbase_url ⇒ Object (readonly)
Returns the value of attribute crunchbase_url.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def crunchbase_url @crunchbase_url end |
#deadpooled_url ⇒ Object (readonly)
Returns the value of attribute deadpooled_url.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def deadpooled_url @deadpooled_url end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def description @description end |
#email_address ⇒ Object (readonly)
Returns the value of attribute email_address.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def email_address @email_address end |
#external_links ⇒ Object (readonly)
Returns the value of attribute external_links.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def external_links @external_links end |
#funding_rounds ⇒ Object (readonly)
Returns the value of attribute funding_rounds.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def funding_rounds @funding_rounds end |
#homepage_url ⇒ Object (readonly)
Returns the value of attribute homepage_url.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def homepage_url @homepage_url end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def image @image end |
#investments ⇒ Object (readonly)
Returns the value of attribute investments.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def investments @investments end |
#ipo ⇒ Object (readonly)
Returns the value of attribute ipo.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def ipo @ipo end |
#milestones ⇒ Object (readonly)
Returns the value of attribute milestones.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def milestones @milestones end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def name @name end |
#number_of_employees ⇒ Object (readonly)
Returns the value of attribute number_of_employees.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def number_of_employees @number_of_employees end |
#offices ⇒ Object (readonly)
Returns the value of attribute offices.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def offices @offices end |
#overview ⇒ Object (readonly)
Returns the value of attribute overview.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def overview @overview end |
#permalink ⇒ Object (readonly)
Returns the value of attribute permalink.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def permalink @permalink end |
#phone_number ⇒ Object (readonly)
Returns the value of attribute phone_number.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def phone_number @phone_number end |
#providerships ⇒ Object (readonly)
Returns the value of attribute providerships.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def providerships @providerships end |
#relationships ⇒ Object (readonly)
Returns the value of attribute relationships.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def relationships @relationships end |
#screenshots ⇒ Object (readonly)
Returns the value of attribute screenshots.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def screenshots @screenshots end |
#total_money_raised ⇒ Object (readonly)
Returns the value of attribute total_money_raised.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def total_money_raised @total_money_raised end |
#twitter_username ⇒ Object (readonly)
Returns the value of attribute twitter_username.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def twitter_username @twitter_username end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def updated_at @updated_at end |
#video_embeds ⇒ Object (readonly)
Returns the value of attribute video_embeds.
11 12 13 |
# File 'lib/crunchbase/company.rb', line 11 def @video_embeds end |
Instance Method Details
#deadpooled ⇒ Object
Returns the date the company was deadpooled, or nil if not provided.
68 69 70 |
# File 'lib/crunchbase/company.rb', line 68 def deadpooled @deadpooled ||= date_from_components(@deadpooled_year, @deadpooled_month, @deadpooled_day) end |
#founded ⇒ Object
Returns the date the company was founded, or nil if not provided.
63 64 65 |
# File 'lib/crunchbase/company.rb', line 63 def founded @founded ||= date_from_components(@founded_year, @founded_month, @founded_day) end |