Class: Crunchbase::Searches::Client

Inherits:
Object
  • Object
show all
Includes:
Utilities::CbModel, Utilities::Request
Defined in:
lib/crunchbase/searches/client.rb

Overview

Send request for entities endpoints

API doc:

https://app.swaggerhub.com/apis-docs/Crunchbase/crunchbase-enterprise_api/1.0.1#/Search/post_searches_organizations

Notes

1. Only can filter `Searchable: Yes` fields
2. 'name', 'website' can not use

Constant Summary collapse

ROOT_LIST =
'searches'
LIMIT =
100

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utilities::CbModel

cbobject, exact_kclass_object, kclass_name

Methods included from Utilities::Request

deleted, entity, get, search

Constructor Details

#initialize(conditions, entity_type) ⇒ Client

Returns a new instance of Client.



26
27
28
29
# File 'lib/crunchbase/searches/client.rb', line 26

def initialize(conditions, entity_type)
  @conditions = conditions
  @entity_type = entity_type
end

Instance Attribute Details

#conditionsObject

Returns the value of attribute conditions.



21
22
23
# File 'lib/crunchbase/searches/client.rb', line 21

def conditions
  @conditions
end

#countObject

Returns the value of attribute count.



21
22
23
# File 'lib/crunchbase/searches/client.rb', line 21

def count
  @count
end

#entitiesObject

Returns the value of attribute entities.



21
22
23
# File 'lib/crunchbase/searches/client.rb', line 21

def entities
  @entities
end

#entity_typeObject

Returns the value of attribute entity_type.



21
22
23
# File 'lib/crunchbase/searches/client.rb', line 21

def entity_type
  @entity_type
end

#total_countObject

Returns the value of attribute total_count.



21
22
23
# File 'lib/crunchbase/searches/client.rb', line 21

def total_count
  @total_count
end

Instance Method Details

#searchesObject

Will include all attribute from API document



32
33
34
35
36
37
38
39
# File 'lib/crunchbase/searches/client.rb', line 32

def searches
  wrapping!(
    search(
      root_uri,
      data_raw.to_s.gsub('=>', ':')
    )
  )
end