Class: Crunchbase::Autocompletes::Client

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

Overview

Send request for autocompletes endpoint

API doc:

https://app.swaggerhub.com/apis-docs/Crunchbase/crunchbase-enterprise_api/1.0.1#/Autocomplete/get_autocompletes

Constant Summary collapse

ROOT_LIST =
'autocompletes'
LIMIT =
25

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(raw_data) ⇒ Client

Returns a new instance of Client.



22
23
24
25
# File 'lib/crunchbase/autocompletes/client.rb', line 22

def initialize(raw_data)
  @conditions = raw_data
  @entity_type = 'autocomplete_entity'
end

Instance Attribute Details

#conditionsObject

Returns the value of attribute conditions.



17
18
19
# File 'lib/crunchbase/autocompletes/client.rb', line 17

def conditions
  @conditions
end

#countObject

Returns the value of attribute count.



17
18
19
# File 'lib/crunchbase/autocompletes/client.rb', line 17

def count
  @count
end

#entitiesObject

Returns the value of attribute entities.



17
18
19
# File 'lib/crunchbase/autocompletes/client.rb', line 17

def entities
  @entities
end

#entity_typeObject

Returns the value of attribute entity_type.



17
18
19
# File 'lib/crunchbase/autocompletes/client.rb', line 17

def entity_type
  @entity_type
end

#total_countObject

Returns the value of attribute total_count.



17
18
19
# File 'lib/crunchbase/autocompletes/client.rb', line 17

def total_count
  @total_count
end

Instance Method Details

#autocompletesObject

Will include all attribute from API document



28
29
30
31
32
33
34
35
# File 'lib/crunchbase/autocompletes/client.rb', line 28

def autocompletes
  wrapping_autocomplete_entities!(
    get(
      ROOT_LIST,
      autocompletes_parameters
    )
  )
end