Class: Crunchbase::OrganizationInvestor

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

Constant Summary

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(hash) ⇒ OrganizationInvestor

Returns a new instance of OrganizationInvestor.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/crunchbase/organization_investor.rb', line 8

def initialize(hash)
  @type_name    = hash["type"]
  if hash["type"] == 'Organization'
    @type         = Organization
    @name         = hash["name"]
  else
    @type         = Person
    @name         = [hash["first_name"], hash["last_name"]].compact.join(' ')
    @first_name   = hash["first_name"]
    @last_name    = hash["last_name"]
  end
  @path         = hash["path"]
  @permalink    = hash["path"] && hash["path"].split('/').last
end

Instance Attribute Details

#first_nameObject (readonly)

Returns the value of attribute first_name.



6
7
8
# File 'lib/crunchbase/organization_investor.rb', line 6

def first_name
  @first_name
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



6
7
8
# File 'lib/crunchbase/organization_investor.rb', line 6

def last_name
  @last_name
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/crunchbase/organization_investor.rb', line 6

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/crunchbase/organization_investor.rb', line 6

def path
  @path
end

Returns the value of attribute permalink.



6
7
8
# File 'lib/crunchbase/organization_investor.rb', line 6

def permalink
  @permalink
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/crunchbase/organization_investor.rb', line 6

def type
  @type
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



6
7
8
# File 'lib/crunchbase/organization_investor.rb', line 6

def type_name
  @type_name
end