Class: Crunchbase::API
- Inherits:
-
Object
- Object
- Crunchbase::API
- Defined in:
- lib/crunchbase/api.rb
Overview
Handles the actual calls to the Crunchbase API through a series of class methods, each referring to a CB entity type. Each method returns the raw JSON returned from the API. You should probably be using the factory methods provided on each entity class instead of calling these directly.
Constant Summary collapse
- CB_URL =
'http://api.crunchbase.com/v/1/'
- SUPPORTED_ENTITIES =
['person', 'company', 'financial-organization', 'product', 'service-provider']
Class Attribute Summary collapse
-
.redirect_limit ⇒ Object
Returns the value of attribute redirect_limit.
-
.timeout_limit ⇒ Object
Returns the value of attribute timeout_limit.
Class Method Summary collapse
Class Attribute Details
.redirect_limit ⇒ Object
Returns the value of attribute redirect_limit.
24 25 26 |
# File 'lib/crunchbase/api.rb', line 24 def redirect_limit @redirect_limit end |
.timeout_limit ⇒ Object
Returns the value of attribute timeout_limit.
24 25 26 |
# File 'lib/crunchbase/api.rb', line 24 def timeout_limit @timeout_limit end |
Class Method Details
.all(entity) ⇒ Object
31 32 33 34 |
# File 'lib/crunchbase/api.rb', line 31 def self.all(entity) uri = CB_URL + entity + ".js" get_json_response(uri) end |
.single_entity(permalink, entity_name) ⇒ Object
26 27 28 29 |
# File 'lib/crunchbase/api.rb', line 26 def self.single_entity(permalink, entity_name) raise CrunchException, "Unsupported Entity Type" unless SUPPORTED_ENTITIES.include?(entity_name) fetch(permalink, entity_name) end |