Class: Crunchbase::BoardMembersAndAdvisor

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

Constant Summary collapse

RESOURCE_LIST =
'board_members_and_advisors'

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

Returns a new instance of BoardMembersAndAdvisor.



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/crunchbase/board_members_and_advisor.rb', line 12

def initialize(json)
  @type_name    = json['type']
  @name         = json['first_name'].to_s + ' ' + json['last_name'].to_s
  @first_name   = json['first_name']
  @last_name    = json['last_name']
  @title        = json['title']
  @path         = json['path']
  @permalink    = (json['permalink'] || (json['path'] && json['path'].gsub('person/', '')))
  @started_on   = json['started_on'] && DateTime.parse(json['started_on'])
  @ended_on     = json['ended_on'] && DateTime.parse(json['ended_on'])
  @created_at   = Time.at(json['created_at']).utc
  @updated_at   = Time.at(json['updated_at']).utc
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def created_at
  @created_at
end

#ended_onObject (readonly)

Returns the value of attribute ended_on.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def ended_on
  @ended_on
end

#first_nameObject (readonly)

Returns the value of attribute first_name.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def first_name
  @first_name
end

#last_nameObject (readonly)

Returns the value of attribute last_name.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def last_name
  @last_name
end

#nameObject (readonly)

Returns the value of attribute name.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def path
  @path
end

Returns the value of attribute permalink.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def permalink
  @permalink
end

#started_onObject (readonly)

Returns the value of attribute started_on.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def started_on
  @started_on
end

#titleObject (readonly)

Returns the value of attribute title.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def title
  @title
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def type_name
  @type_name
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



9
10
11
# File 'lib/crunchbase/board_members_and_advisor.rb', line 9

def updated_at
  @updated_at
end