Class: Crunchbase::FirmRelationship
- Inherits:
-
Relationship
- Object
- Relationship
- Crunchbase::FirmRelationship
- Defined in:
- lib/crunchbase/relationships/firm_relationship.rb
Instance Attribute Summary collapse
-
#firm_name ⇒ Object
readonly
Returns the value of attribute firm_name.
-
#firm_permalink ⇒ Object
readonly
Returns the value of attribute firm_permalink.
-
#firm_type ⇒ Object
readonly
Returns the value of attribute firm_type.
Attributes inherited from Relationship
Class Method Summary collapse
Instance Method Summary collapse
-
#firm(force_reload = false) ⇒ Object
Returns a representation of the associated firm, loading from memory if previously fetched, unless force_reload is set to true.
-
#initialize(hash) ⇒ FirmRelationship
constructor
A new instance of FirmRelationship.
Methods inherited from Relationship
Constructor Details
#initialize(hash) ⇒ FirmRelationship
Returns a new instance of FirmRelationship.
10 11 12 13 14 15 |
# File 'lib/crunchbase/relationships/firm_relationship.rb', line 10 def initialize(hash) super(hash) @firm_name = hash["firm"]["name"] @firm_permalink = hash["firm"]["permalink"] @firm_type = hash["firm"]["type_of_entity"] end |
Instance Attribute Details
#firm_name ⇒ Object (readonly)
Returns the value of attribute firm_name.
4 5 6 |
# File 'lib/crunchbase/relationships/firm_relationship.rb', line 4 def firm_name @firm_name end |
#firm_permalink ⇒ Object (readonly)
Returns the value of attribute firm_permalink.
4 5 6 |
# File 'lib/crunchbase/relationships/firm_relationship.rb', line 4 def firm_permalink @firm_permalink end |
#firm_type ⇒ Object (readonly)
Returns the value of attribute firm_type.
4 5 6 |
# File 'lib/crunchbase/relationships/firm_relationship.rb', line 4 def firm_type @firm_type end |
Class Method Details
.array_from_relationship_list ⇒ Object
:nodoc:
6 7 8 |
# File 'lib/crunchbase/relationships/firm_relationship.rb', line 6 def self.array_from_relationship_list #:nodoc: raise CrunchException, "Method must be called from superclass Relationship" end |
Instance Method Details
#firm(force_reload = false) ⇒ Object
Returns a representation of the associated firm, loading from memory if previously fetched, unless force_reload is set to true.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/crunchbase/relationships/firm_relationship.rb', line 19 def firm(force_reload=false) return @firm unless @firm.nil? || force_reload @firm = case @firm_type when "company" Company.get(@firm_permalink) when "financial_org" FinancialOrganization.get(@firm_permalink) else raise CrunchException, "Not implemented" end return @firm end |