Class: Crunchbase::Client
- Inherits:
-
Object
- Object
- Crunchbase::Client
- Defined in:
- lib/crunchbase/client.rb
Instance Method Summary collapse
-
#get(permalink, kclass_name, relationship_name = nil) ⇒ Object
Get information by permalink with optional one relationship.
- #list(kclass_name, options = {}) ⇒ Object
-
#organization(permalink, kclass_name = nil) ⇒ Object
Get organization information by the permalink.
-
#person(permalink, kclass_name = nil) ⇒ Object
Get person information by the permalink.
- #request_perform(stand_kclass, permalink, kclass_name) ⇒ Object
-
#search(options, kclass_name) ⇒ Object
options -> { query: “Ekohe” } || { name: “Ekohe” } || { domain_name: “ekohe.com” }.
Instance Method Details
#get(permalink, kclass_name, relationship_name = nil) ⇒ Object
Get information by permalink with optional one relationship
7 8 9 10 11 12 13 14 |
# File 'lib/crunchbase/client.rb', line 7 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 = {}) ⇒ Object
26 27 28 29 30 |
# File 'lib/crunchbase/client.rb', line 26 def list(kclass_name, = {}) page = [:page] || 1 kclass(kclass_name).list(page) end |
#organization(permalink, kclass_name = nil) ⇒ Object
Get organization information by the permalink
17 18 19 |
# File 'lib/crunchbase/client.rb', line 17 def organization(permalink, kclass_name = nil) request_perform('Organization', permalink, kclass_name) end |
#person(permalink, kclass_name = nil) ⇒ Object
Get person information by the permalink
22 23 24 |
# File 'lib/crunchbase/client.rb', line 22 def person(permalink, kclass_name = nil) request_perform('Person', permalink, kclass_name) end |
#request_perform(stand_kclass, permalink, kclass_name) ⇒ Object
39 40 41 42 43 |
# File 'lib/crunchbase/client.rb', line 39 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) ⇒ Object
options -> { query: “Ekohe” } || { name: “Ekohe” } || { domain_name: “ekohe.com” }
33 34 35 36 37 |
# File 'lib/crunchbase/client.rb', line 33 def search(, kclass_name) return [] if kclass_name.nil? kclass('Search').search(, kclass_name) end |