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, #fetch, get, list, lists_for_permalink, search, total_items_from_list

Constructor Details

#initialize(json) ⇒ FundingRound

Returns a new instance of FundingRound.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/crunchbase/funding_round.rb', line 19

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

  @name           = properties['name']
  @funding_type   = properties['funding_type']
  @permalink      = properties['permalink']
  @money_raised_usd   = properties['money_raised_usd']
  @announced_on       = properties['announced_on'] && DateTime.parse(properties['announced_on'])
  @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']

  @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.



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

def announced_on
  @announced_on
end

#announced_on_trust_codeObject (readonly)

Returns the value of attribute announced_on_trust_code.



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

def announced_on_trust_code
  @announced_on_trust_code
end

#canonical_currency_codeObject (readonly)

Returns the value of attribute canonical_currency_code.



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

def canonical_currency_code
  @canonical_currency_code
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#funded_organizationsObject (readonly)

Returns the value of attribute funded_organizations.



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

def funded_organizations
  @funded_organizations
end

#funded_organizations_total_itemsObject (readonly)

Returns the value of attribute funded_organizations_total_items.



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

def funded_organizations_total_items
  @funded_organizations_total_items
end

#funding_typeObject (readonly)

Returns the value of attribute funding_type.



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

def funding_type
  @funding_type
end

#investmentsObject (readonly)

Returns the value of attribute investments.



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

def investments
  @investments
end

#investments_total_itemsObject (readonly)

Returns the value of attribute investments_total_items.



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

def investments_total_items
  @investments_total_items
end

#money_raisedObject (readonly)

Returns the value of attribute money_raised.



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

def money_raised
  @money_raised
end

#money_raised_currency_codeObject (readonly)

Returns the value of attribute money_raised_currency_code.



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

def money_raised_currency_code
  @money_raised_currency_code
end

#money_raised_usdObject (readonly)

Returns the value of attribute money_raised_usd.



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

def money_raised_usd
  @money_raised_usd
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#new_itemsObject (readonly)

Returns the value of attribute new_items.



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

def new_items
  @new_items
end

#new_items_total_itemsObject (readonly)

Returns the value of attribute new_items_total_items.



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

def new_items_total_items
  @new_items_total_items
end

Returns the value of attribute permalink.



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

def permalink
  @permalink
end

#post_money_valuation_currency_codeObject (readonly)

Returns the value of attribute post_money_valuation_currency_code.



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

def post_money_valuation_currency_code
  @post_money_valuation_currency_code
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



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

def type_name
  @type_name
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end