Class: Crunchbase::API
- Inherits:
-
Object
- Object
- Crunchbase::API
- Defined in:
- lib/crunchbase/api.rb
Constant Summary collapse
- SUPPORTED_ENTITIES =
['organizations', 'organization', 'people', 'person', 'products', 'product', 'funding_rounds', 'funding-round', 'acquisition', 'ipo', 'fund-raise', 'locations', 'categories', 'offices', 'customers', 'degrees', 'experience', 'primary_affiliation', 'videos', 'founded_companies', 'primary_location', 'advisor_at']
- RESOURCE_NAME =
Must be overridden in subclasses
"undefined"
- RESOURCE_LIST =
"undefineds"
- ORDER_CREATED_AT_ASC =
'created_at asc'
- ORDER_CREATED_AT_DESC =
'created_at desc'
- ORDER_UPDATED_AT_ASC =
'updated_at asc'
- ORDER_UPDATED_AT_DESC =
'updated_at desc'
Class Attribute Summary collapse
-
.base_url ⇒ Object
Returns the value of attribute base_url.
-
.debug ⇒ Object
Returns the value of attribute debug.
-
.image_url ⇒ Object
Returns the value of attribute image_url.
-
.key ⇒ Object
Returns the value of attribute key.
-
.redirect_limit ⇒ Object
Returns the value of attribute redirect_limit.
-
.site_url ⇒ Object
Returns the value of attribute site_url.
-
.timeout_limit ⇒ Object
Returns the value of attribute timeout_limit.
-
.version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Class Attribute Details
.base_url ⇒ Object
Returns the value of attribute base_url.
36 37 38 |
# File 'lib/crunchbase/api.rb', line 36 def base_url @base_url end |
.debug ⇒ Object
Returns the value of attribute debug.
36 37 38 |
# File 'lib/crunchbase/api.rb', line 36 def debug @debug end |
.image_url ⇒ Object
Returns the value of attribute image_url.
36 37 38 |
# File 'lib/crunchbase/api.rb', line 36 def image_url @image_url end |
.key ⇒ Object
Returns the value of attribute key.
36 37 38 |
# File 'lib/crunchbase/api.rb', line 36 def key @key end |
.redirect_limit ⇒ Object
Returns the value of attribute redirect_limit.
36 37 38 |
# File 'lib/crunchbase/api.rb', line 36 def redirect_limit @redirect_limit end |
.site_url ⇒ Object
Returns the value of attribute site_url.
36 37 38 |
# File 'lib/crunchbase/api.rb', line 36 def site_url @site_url end |
.timeout_limit ⇒ Object
Returns the value of attribute timeout_limit.
36 37 38 |
# File 'lib/crunchbase/api.rb', line 36 def timeout_limit @timeout_limit end |
.version ⇒ Object
Returns the value of attribute version.
36 37 38 |
# File 'lib/crunchbase/api.rb', line 36 def version @version end |
Class Method Details
.all(entity) ⇒ Object
50 51 52 |
# File 'lib/crunchbase/api.rb', line 50 def self.all(entity) get_json_response( api_url + entity ) end |
.api_url ⇒ Object
39 40 41 |
# File 'lib/crunchbase/api.rb', line 39 def api_url base_url.gsub(/\/$/, '') + '/v/' + version + '/' end |
.single_entity(permalink, entity_name) ⇒ Object
44 45 46 47 48 |
# File 'lib/crunchbase/api.rb', line 44 def self.single_entity(permalink, entity_name) raise CrunchException, "Unsupported Entity Type" unless SUPPORTED_ENTITIES.include?(entity_name) fetch(permalink, entity_name) end |