Class: Crunchbase::Company

Inherits:
CB_Object show all
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

Instance Method Summary collapse

Methods included from DateMethods

#date_from_components

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

#acquisitionObject (readonly)

Returns the value of attribute acquisition.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def acquisition
  @acquisition
end

#acquisitionsObject (readonly)

Returns the value of attribute acquisitions.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def acquisitions
  @acquisitions
end

#blog_feed_urlObject (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_urlObject (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_codeObject (readonly)

Returns the value of attribute category_code.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def category_code
  @category_code
end

#competitionsObject (readonly)

Returns the value of attribute competitions.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def competitions
  @competitions
end

#created_atObject (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_urlObject (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_urlObject (readonly)

Returns the value of attribute deadpooled_url.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def deadpooled_url
  @deadpooled_url
end

#descriptionObject (readonly)

Returns the value of attribute description.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def description
  @description
end

#email_addressObject (readonly)

Returns the value of attribute email_address.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def email_address
  @email_address
end

Returns the value of attribute external_links.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def external_links
  @external_links
end

#funding_roundsObject (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_urlObject (readonly)

Returns the value of attribute homepage_url.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def homepage_url
  @homepage_url
end

#imageObject (readonly)

Returns the value of attribute image.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def image
  @image
end

#investmentsObject (readonly)

Returns the value of attribute investments.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def investments
  @investments
end

#ipoObject (readonly)

Returns the value of attribute ipo.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def ipo
  @ipo
end

#milestonesObject (readonly)

Returns the value of attribute milestones.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def milestones
  @milestones
end

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def name
  @name
end

#number_of_employeesObject (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

#officesObject (readonly)

Returns the value of attribute offices.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def offices
  @offices
end

#overviewObject (readonly)

Returns the value of attribute overview.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def overview
  @overview
end

Returns the value of attribute permalink.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def permalink
  @permalink
end

#phone_numberObject (readonly)

Returns the value of attribute phone_number.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def phone_number
  @phone_number
end

#providershipsObject (readonly)

Returns the value of attribute providerships.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def providerships
  @providerships
end

#relationshipsObject (readonly)

Returns the value of attribute relationships.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def relationships
  @relationships
end

#screenshotsObject (readonly)

Returns the value of attribute screenshots.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def screenshots
  @screenshots
end

#total_money_raisedObject (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_usernameObject (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_atObject (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_embedsObject (readonly)

Returns the value of attribute video_embeds.



11
12
13
# File 'lib/crunchbase/company.rb', line 11

def video_embeds
  @video_embeds
end

Instance Method Details

#deadpooledObject

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

#foundedObject

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

#productsObject

Returns an array of Product objects, representing this Company’s products.



73
74
75
# File 'lib/crunchbase/company.rb', line 73

def products
  @products ||= @products_list.map {|p| Product.get(p['permalink']) }
end