Class: Crunchbase::FundingRound

Inherits:
CBEntity
  • Object
show all
Defined in:
lib/crunchbase/funding_round.rb

Constant Summary collapse

RESOURCE_NAME =
'funding-round'
RESOURCE_LIST =
'funding_rounds'

Constants inherited from CBEntity

CBEntity::RELATIONSHIPS

Instance Attribute Summary collapse

Instance Method Summary collapse

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) ⇒ FundingRound

Returns a new instance of FundingRound.



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
# File 'lib/crunchbase/funding_round.rb', line 22

def initialize(json)
  @type_name          = json['type']
  properties          = json['properties']
  relationships       = json['relationships']

  @name               = properties['name']
  @funding_type       = properties['funding_type']
  @permalink          = properties['permalink']
  @series             = properties['series']
  @money_raised_usd   = properties['money_raised_usd']
  
  if (properties['announced_on'].blank? || properties['announced_on'] == "0000-01-01")
    @announced_on = nil
  else
    @announced_on = DateTime.parse(properties['announced_on'])
  end
  @announced_on_year    = properties['announced_on_year']
  @announced_on_month   = properties['announced_on_month']
  @announced_on_day     = properties['announced_on_day']

  @announced_on_trust_code    = properties['announced_on_trust_code']
  @canonical_currency_code    = properties['canonical_currency_code']
  @money_raised               = properties['money_raised']
  @created_at                 = Time.at(properties['created_at']).utc
  @updated_at                 = Time.at(properties['updated_at']).utc
  @money_raised_currency_code           = properties['money_raised_currency_code']
  @post_money_valuation_currency_code   = properties['post_money_valuation_currency_code']

  @post_money_valuation_usd   = properties['post_money_valuation_usd']
  @target_money_raised_usd    = properties['target_money_raised_usd']
  @pre_money_valuation_usd    = properties['pre_money_valuation_usd']
  @pre_money_valuation        = properties['pre_money_valuation']
  @pre_money_valuation_currency_code   = properties['pre_money_valuation_currency_code']

  @investments_list           = relationships['investments']
  @funded_organizations_list  = relationships['funded_organization']
  @new_items_list             = relationships['news']
end

Instance Attribute Details

#announced_onObject (readonly)

Returns the value of attribute announced_on.



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

def announced_on
  @announced_on
end

#announced_on_dayObject (readonly)

Returns the value of attribute announced_on_day.



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

def announced_on_day
  @announced_on_day
end

#announced_on_monthObject (readonly)

Returns the value of attribute announced_on_month.



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

def announced_on_month
  @announced_on_month
end

#announced_on_trust_codeObject (readonly)

Returns the value of attribute announced_on_trust_code.



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

def announced_on_trust_code
  @announced_on_trust_code
end

#announced_on_yearObject (readonly)

Returns the value of attribute announced_on_year.



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

def announced_on_year
  @announced_on_year
end

#canonical_currency_codeObject (readonly)

Returns the value of attribute canonical_currency_code.



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

def canonical_currency_code
  @canonical_currency_code
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#funded_organizationsObject (readonly)

Returns the value of attribute funded_organizations.



18
19
20
# File 'lib/crunchbase/funding_round.rb', line 18

def funded_organizations
  @funded_organizations
end

#funded_organizations_total_itemsObject (readonly)

Returns the value of attribute funded_organizations_total_items.



20
21
22
# File 'lib/crunchbase/funding_round.rb', line 20

def funded_organizations_total_items
  @funded_organizations_total_items
end

#funding_typeObject (readonly)

Returns the value of attribute funding_type.



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

def funding_type
  @funding_type
end

#investmentsObject (readonly)

Returns the value of attribute investments.



18
19
20
# File 'lib/crunchbase/funding_round.rb', line 18

def investments
  @investments
end

#investments_total_itemsObject (readonly)

Returns the value of attribute investments_total_items.



20
21
22
# File 'lib/crunchbase/funding_round.rb', line 20

def investments_total_items
  @investments_total_items
end

#money_raisedObject (readonly)

Returns the value of attribute money_raised.



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

def money_raised
  @money_raised
end

#money_raised_currency_codeObject (readonly)

Returns the value of attribute money_raised_currency_code.



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

def money_raised_currency_code
  @money_raised_currency_code
end

#money_raised_usdObject (readonly)

Returns the value of attribute money_raised_usd.



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

def money_raised_usd
  @money_raised_usd
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#new_itemsObject (readonly)

Returns the value of attribute new_items.



18
19
20
# File 'lib/crunchbase/funding_round.rb', line 18

def new_items
  @new_items
end

#new_items_total_itemsObject (readonly)

Returns the value of attribute new_items_total_items.



20
21
22
# File 'lib/crunchbase/funding_round.rb', line 20

def new_items_total_items
  @new_items_total_items
end

Returns the value of attribute permalink.



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

def permalink
  @permalink
end

#post_money_valuation_currency_codeObject (readonly)

Returns the value of attribute post_money_valuation_currency_code.



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

def post_money_valuation_currency_code
  @post_money_valuation_currency_code
end

#post_money_valuation_usdObject (readonly)

Returns the value of attribute post_money_valuation_usd.



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

def post_money_valuation_usd
  @post_money_valuation_usd
end

#pre_money_valuationObject (readonly)

Returns the value of attribute pre_money_valuation.



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

def pre_money_valuation
  @pre_money_valuation
end

#pre_money_valuation_currency_codeObject (readonly)

Returns the value of attribute pre_money_valuation_currency_code.



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

def pre_money_valuation_currency_code
  @pre_money_valuation_currency_code
end

#pre_money_valuation_usdObject (readonly)

Returns the value of attribute pre_money_valuation_usd.



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

def pre_money_valuation_usd
  @pre_money_valuation_usd
end

#seriesObject (readonly)

Returns the value of attribute series.



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

def series
  @series
end

#target_money_raised_usdObject (readonly)

Returns the value of attribute target_money_raised_usd.



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

def target_money_raised_usd
  @target_money_raised_usd
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



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

def type_name
  @type_name
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end