class Crunchbase::Model::FundingRound

Constants

RESOURCE_LIST
RESOURCE_NAME

Attributes

announced_on[R]
announced_on_trust_code[R]
api_path[R]
closed_on[R]
closed_on_trust_code[R]
created_at[R]
funded_organization[R]
funded_organization_total_items[R]
funding_type[R]
images[R]
images_total_items[R]
investments[R]
investments_total_items[R]
investors[R]
investors_total_items[R]
money_raised[R]
money_raised_currency_code[R]
money_raised_usd[R]
news[R]
news_total_items[R]
series[R]
series_qualifier[R]
target_money_raised[R]
target_money_raised_currency_code[R]
target_money_raised_usd[R]
updated_at[R]
videos[R]
videos_total_items[R]
web_path[R]

Public Class Methods

new(json) click to toggle source
Calls superclass method Crunchbase::Model::Entity::new
# File lib/crunchbase/model/funding_round.rb, line 19
def initialize(json)
  super(json)

  relationships = json['relationships']
  return if relationships.nil?

  relationship_with_funded(relationships['funded_organization'])
end

Public Instance Methods

date_keys() click to toggle source
# File lib/crunchbase/model/funding_round.rb, line 61
def date_keys
  %w(announced_on closed_on)
end
property_keys() click to toggle source
# File lib/crunchbase/model/funding_round.rb, line 51
def property_keys
  %w(
    permalink api_path web_path funding_type series series_qualifier
    announced_on announced_on_trust_code closed_on closed_on_trust_code
    money_raised money_raised_currency_code money_raised_usd
    target_money_raised target_money_raised_currency_code target_money_raised_usd
    created_at updated_at
  )
end
relationship_lists() click to toggle source
# File lib/crunchbase/model/funding_round.rb, line 41
def relationship_lists
  {
    'investments' => Investment,
    'images' => Image,
    'videos' => Video,
    'news' => New,
    'investors' => Investor
  }
end
relationship_with_funded(funded_organization) click to toggle source
# File lib/crunchbase/model/funding_round.rb, line 28
def relationship_with_funded(funded_organization)
  return if funded_organization.nil?

  if funded_organization['item'].nil?
    # Get organization's  (investments - funding - organization)
    instance_relationships_object(Organization, 'funded_organization', funded_organization)
  else
    # Get funding-rounds (funded_organization - item)

    set_relationships_object(Organization, 'funded_organization', funded_organization)
  end
end