class Crunchbase::Client
Public Instance Methods
batch_search(requests)
click to toggle source
Runs a batch search and returns matched results Params:
requests
-
An array of hashes with following attributes: { 'type': String, 'uuid': String, 'relationships': String[] }
# File lib/crunchbase/client.rb, line 47 def batch_search(requests) return [] if requests.nil? kclass('BatchSearch').batch_search(requests) end
get(permalink, kclass_name, relationship_name = nil)
click to toggle source
Get information by permalink with optional one relationship
# File lib/crunchbase/client.rb, line 6 def get(permalink, kclass_name, relationship_name = nil) case kclass_name when 'Person' person(permalink, relationship_name) when 'Organization' organization(permalink, relationship_name) end end
list(kclass_name, options = {})
click to toggle source
# File lib/crunchbase/client.rb, line 25 def list(kclass_name, options = {}) page = options[:page] || 1 kclass(kclass_name).list(page) end
organization(permalink, kclass_name = nil)
click to toggle source
Get organization information by the permalink
# File lib/crunchbase/client.rb, line 16 def organization(permalink, kclass_name = nil) request_perform('Organization', permalink, kclass_name) end
person(permalink, kclass_name = nil)
click to toggle source
Get person information by the permalink
# File lib/crunchbase/client.rb, line 21 def person(permalink, kclass_name = nil) request_perform('Person', permalink, kclass_name) end
request_perform(stand_kclass, permalink, kclass_name)
click to toggle source
# File lib/crunchbase/client.rb, line 38 def request_perform(stand_kclass, permalink, kclass_name) return kclass(stand_kclass).get(permalink) if kclass_name.nil? kclass(kclass_name).organization_lists(permalink) end
search(options, kclass_name)
click to toggle source
options -> { query: “Ekohe” } || { name: “Ekohe” } || { domain_name: “ekohe.com” }
# File lib/crunchbase/client.rb, line 32 def search(options, kclass_name) return [] if kclass_name.nil? kclass('Search').search(options, kclass_name) end
Private Instance Methods
kclass(kclass_name)
click to toggle source
# File lib/crunchbase/client.rb, line 55 def kclass(kclass_name) Crunchbase::Model.const_get kclass_name end