Class: Crunchbase::Model::PrimaryAffiliation
- Defined in:
- lib/crunchbase/model/primary_affiliation.rb
Constant Summary
Constants inherited from Job
Instance Attribute Summary collapse
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
Attributes inherited from Job
#created_at, #ended_on, #ended_on_trust_code, #person, #started_on, #started_on_trust_code, #title, #updated_at
Attributes inherited from Entity
Instance Method Summary collapse
-
#initialize(json) ⇒ PrimaryAffiliation
constructor
A new instance of PrimaryAffiliation.
- #set_relationships_object(object_name, key, item) ⇒ Object
Methods inherited from Job
Methods inherited from Entity
array_from_list, #fetch, funding_rounds_lists, get, list, organization_lists, parsing_from_list, person_lists, total_items_from_list
Constructor Details
#initialize(json) ⇒ PrimaryAffiliation
Returns a new instance of PrimaryAffiliation.
8 9 10 11 12 13 14 |
# File 'lib/crunchbase/model/primary_affiliation.rb', line 8 def initialize(json) super unless (relationships = json['relationships']).nil? set_relationships_object(Crunchbase::Model::Organization, 'organization', relationships['organization']) end end |
Instance Attribute Details
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
6 7 8 |
# File 'lib/crunchbase/model/primary_affiliation.rb', line 6 def organization @organization end |
Instance Method Details
#set_relationships_object(object_name, key, item) ⇒ Object
16 17 18 19 20 |
# File 'lib/crunchbase/model/primary_affiliation.rb', line 16 def set_relationships_object(object_name, key, item) return unless item instance_variable_set "@#{key}", ( object_name.new(item) || nil ) end |