Class: Crunchbase::Acquisition

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

Constant Summary collapse

RESOURCE_NAME =
'acquisition'
RESOURCE_LIST =
'acquisitions'

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

Returns a new instance of Acquisition.



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

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

  @announced_on             = properties['announced_on'] && DateTime.parse(properties['announced_on'])
  @announced_on_trust_code  = properties['announced_on_trust_code']
  @price_currency_code      = properties['price_currency_code']
  @permalink                = properties['permalink']
  @name                     = properties['name']
  @payment_type             = properties['payment_type']
  @price                    = properties['price']
  @disposition_of_acquired  = properties['disposition_of_acquired']
  @acquisition_type         = properties['acquisition_type']
  @acquisition_status       = properties['acquisition_status']
  @price_usd                = properties['price_usd']
  @announced_on_year        = properties['announced_on_year']
  @announced_on_day         = properties['announced_on_day']
  @announced_on_month       = properties['announced_on_month']
  @created_at               = Time.at(properties['created_at']).utc
  @updated_at               = Time.at(properties['updated_at']).utc

  @acquirers_list           = relationships['acquirer']
  @acquirees_list           = relationships['acquiree']
  @new_items_list           = relationships['news']
end

Instance Attribute Details

#acquireesObject (readonly)

Returns the value of attribute acquirees.



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

def acquirees
  @acquirees
end

#acquirees_total_itemsObject (readonly)

Returns the value of attribute acquirees_total_items.



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

def acquirees_total_items
  @acquirees_total_items
end

#acquirersObject (readonly)

Returns the value of attribute acquirers.



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

def acquirers
  @acquirers
end

#acquirers_total_itemsObject (readonly)

Returns the value of attribute acquirers_total_items.



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

def acquirers_total_items
  @acquirers_total_items
end

#acquisition_statusObject (readonly)

Returns the value of attribute acquisition_status.



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

def acquisition_status
  @acquisition_status
end

#acquisition_typeObject (readonly)

Returns the value of attribute acquisition_type.



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

def acquisition_type
  @acquisition_type
end

#announced_onObject (readonly)

Returns the value of attribute announced_on.



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

def announced_on
  @announced_on
end

#announced_on_dayObject (readonly)

Returns the value of attribute announced_on_day.



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

def announced_on_day
  @announced_on_day
end

#announced_on_monthObject (readonly)

Returns the value of attribute announced_on_month.



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

def announced_on_month
  @announced_on_month
end

#announced_on_trust_codeObject (readonly)

Returns the value of attribute announced_on_trust_code.



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

def announced_on_trust_code
  @announced_on_trust_code
end

#announced_on_yearObject (readonly)

Returns the value of attribute announced_on_year.



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

def announced_on_year
  @announced_on_year
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#disposition_of_acquiredObject (readonly)

Returns the value of attribute disposition_of_acquired.



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

def disposition_of_acquired
  @disposition_of_acquired
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#new_itemsObject (readonly)

Returns the value of attribute new_items.



15
16
17
# File 'lib/crunchbase/acquisition.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/acquisition.rb', line 17

def new_items_total_items
  @new_items_total_items
end

#payment_typeObject (readonly)

Returns the value of attribute payment_type.



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

def payment_type
  @payment_type
end

Returns the value of attribute permalink.



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

def permalink
  @permalink
end

#priceObject (readonly)

Returns the value of attribute price.



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

def price
  @price
end

#price_currency_codeObject (readonly)

Returns the value of attribute price_currency_code.



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

def price_currency_code
  @price_currency_code
end

#price_usdObject (readonly)

Returns the value of attribute price_usd.



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

def price_usd
  @price_usd
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end