Class: Crunchbase::ProviderRelationship

Inherits:
Relationship show all
Defined in:
lib/crunchbase/relationships/provider_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) ⇒ ProviderRelationship

Returns a new instance of ProviderRelationship.



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

def initialize(hash)
  super(hash)
  @provider_name = hash["provider"]["name"]
  @provider_permalink = hash["provider"]["permalink"]
end

Instance Attribute Details

#provider_nameObject (readonly)

Returns the value of attribute provider_name.



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

def provider_name
  @provider_name
end

Returns the value of attribute provider_permalink.



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

def provider_permalink
  @provider_permalink
end

Class Method Details

.array_from_relationship_listObject

:nodoc:

Raises:



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

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

Instance Method Details

#provider(force_reload = false) ⇒ Object

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



18
19
20
21
# File 'lib/crunchbase/relationships/provider_relationship.rb', line 18

def provider(force_reload=false)
  return @provider unless @provider.nil? || force_reload
  @provider = ServiceProvider.get(@provider_permalink)
end