Class: Crunchbase::PersonRelationship
- Inherits:
-
Relationship
- Object
- Relationship
- Crunchbase::PersonRelationship
- Defined in:
- lib/crunchbase/relationships/person_relationship.rb
Instance Attribute Summary collapse
-
#person_first_name ⇒ Object
readonly
Returns the value of attribute person_first_name.
-
#person_last_name ⇒ Object
readonly
Returns the value of attribute person_last_name.
-
#person_permalink ⇒ Object
readonly
Returns the value of attribute person_permalink.
Attributes inherited from Relationship
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ PersonRelationship
constructor
A new instance of PersonRelationship.
-
#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.
Methods inherited from Relationship
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_name ⇒ Object (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_name ⇒ Object (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 |
#person_permalink ⇒ Object (readonly)
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_list ⇒ Object
:nodoc:
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 |