Class: Crunchbase::Investment
- Defined in:
- lib/crunchbase/investment.rb
Constant Summary collapse
- RESOURCE_LIST =
'investments'
Constants inherited from CBEntity
Instance Attribute Summary collapse
-
#funding_round_path ⇒ Object
readonly
Returns the value of attribute funding_round_path.
-
#invested_in_name ⇒ Object
readonly
Returns the value of attribute invested_in_name.
-
#invested_in_path ⇒ Object
readonly
Returns the value of attribute invested_in_path.
-
#invested_in_type ⇒ Object
readonly
Returns the value of attribute invested_in_type.
-
#money_invested ⇒ Object
readonly
Returns the value of attribute money_invested.
-
#money_invested_currency_code ⇒ Object
readonly
Returns the value of attribute money_invested_currency_code.
-
#money_invested_usd ⇒ Object
readonly
Returns the value of attribute money_invested_usd.
-
#type_name ⇒ Object
readonly
Returns the value of attribute type_name.
Instance Method Summary collapse
-
#initialize(json) ⇒ Investment
constructor
A new instance of Investment.
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) ⇒ Investment
Returns a new instance of Investment.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/crunchbase/investment.rb', line 14 def initialize(json) @type_name = json['type'] @money_invested = json['money_invested'] @money_invested_currency_code = json['money_invested_currency_code'] @money_invested_usd = json['money_invested_usd'] @funding_round_path = json['funding_round'] && json['funding_round']['path'] if json['invested_in_type'] @invested_in_type = json['invested_in_type'] && json['invested_in_type']['type'] @invested_in_name = json['invested_in_type'] && json['invested_in_type']['name'] @invested_in_path = json['invested_in_type'] && json['invested_in_type']['path'] elsif json['invested_in'] # From one's organization investments @invested_in_type = json['invested_in'] && json['invested_in']['type'] @invested_in_name = json['invested_in'] && json['invested_in']['name'] @invested_in_path = json['invested_in'] && json['invested_in']['path'] elsif json['investor'] @invested_in_type = json['investor'] && json['investor']['type'] @invested_in_name = json['investor'] && json['investor']['name'] @invested_in_path = json['investor'] && json['investor']['path'] end end |
Instance Attribute Details
#funding_round_path ⇒ Object (readonly)
Returns the value of attribute funding_round_path.
10 11 12 |
# File 'lib/crunchbase/investment.rb', line 10 def funding_round_path @funding_round_path end |
#invested_in_name ⇒ Object (readonly)
Returns the value of attribute invested_in_name.
10 11 12 |
# File 'lib/crunchbase/investment.rb', line 10 def invested_in_name @invested_in_name end |
#invested_in_path ⇒ Object (readonly)
Returns the value of attribute invested_in_path.
10 11 12 |
# File 'lib/crunchbase/investment.rb', line 10 def invested_in_path @invested_in_path end |
#invested_in_type ⇒ Object (readonly)
Returns the value of attribute invested_in_type.
10 11 12 |
# File 'lib/crunchbase/investment.rb', line 10 def invested_in_type @invested_in_type end |
#money_invested ⇒ Object (readonly)
Returns the value of attribute money_invested.
10 11 12 |
# File 'lib/crunchbase/investment.rb', line 10 def money_invested @money_invested end |
#money_invested_currency_code ⇒ Object (readonly)
Returns the value of attribute money_invested_currency_code.
10 11 12 |
# File 'lib/crunchbase/investment.rb', line 10 def money_invested_currency_code @money_invested_currency_code end |
#money_invested_usd ⇒ Object (readonly)
Returns the value of attribute money_invested_usd.
10 11 12 |
# File 'lib/crunchbase/investment.rb', line 10 def money_invested_usd @money_invested_usd end |
#type_name ⇒ Object (readonly)
Returns the value of attribute type_name.
10 11 12 |
# File 'lib/crunchbase/investment.rb', line 10 def type_name @type_name end |