Class: Crunchbase::PersonRelationship

Inherits:
Relationship show all
Defined in:
lib/crunchbase/relationships/person_relationship.rb

Instance Attribute Summary collapse

Attributes inherited from Relationship

#title

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Relationship

#current?, #is_past?

Constructor Details

#initialize(hash) ⇒ PersonRelationship

Returns a new instance of PersonRelationship.



10
11
12
13
14
15
# File 'lib/crunchbase/relationships/person_relationship.rb', line 10

def initialize(hash)
  super(hash)
  @person_first_name = hash["person"]["first_name"]
  @person_last_name = hash["person"]["last_name"]
  @person_permalink = hash["person"]["permalink"]
end

Instance Attribute Details

#person_first_nameObject (readonly)

Returns the value of attribute person_first_name.



4
5
6
# File 'lib/crunchbase/relationships/person_relationship.rb', line 4

def person_first_name
  @person_first_name
end

#person_last_nameObject (readonly)

Returns the value of attribute person_last_name.



4
5
6
# File 'lib/crunchbase/relationships/person_relationship.rb', line 4

def person_last_name
  @person_last_name
end

Returns the value of attribute person_permalink.



4
5
6
# File 'lib/crunchbase/relationships/person_relationship.rb', line 4

def person_permalink
  @person_permalink
end

Class Method Details

.array_from_relationship_listObject

:nodoc:

Raises:



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

def self.array_from_relationship_list #:nodoc:
  raise CrunchException, "Method must be called from superclass Relationship"
end

Instance Method Details

#person(force_reload = false) ⇒ Object

Returns a representation of the associated person, loading from memory if previously fetched, unless force_reload is set to true.



19
20
21
22
# File 'lib/crunchbase/relationships/person_relationship.rb', line 19

def person(force_reload=false)
  return @person unless @person.nil? || force_reload
  @person = Person.get(@person_permalink)
end