Class: Swiftype::Client
- Inherits:
-
Object
- Object
- Swiftype::Client
- Includes:
- Analytics, Clickthrough, Document, DocumentType, Domain, Engine, Search, User, Request
- Defined in:
- lib/swiftype/client.rb
Overview
API client for the Swiftype API.
Defined Under Namespace
Modules: Analytics, Clickthrough, Document, DocumentType, Domain, Engine, Search, User
Constant Summary collapse
- DEFAULT_TIMEOUT =
15
Class Method Summary collapse
Instance Method Summary collapse
- #api_key ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
Create a new Swiftype::Client client.
- #open_timeout ⇒ Object
- #overall_timeout ⇒ Object
- #platform_access_token ⇒ Object
- #proxy ⇒ Object
- #wrap(element) ⇒ Object
Methods included from Clickthrough
Methods included from Domain
#crawl_url, #create_domain, #destroy_domain, #domain, #domains, #recrawl_domain
Methods included from Analytics
#analytics_autoselects, #analytics_clicks, #analytics_searches, #analytics_top_no_result_queries, #analytics_top_queries
Methods included from Document
#async_create_or_update_documents, #create_document, #create_documents, #create_or_update_document, #create_or_update_documents, #create_or_update_documents_verbose, #destroy_document, #destroy_documents, #document, #document_receipts, #documents, #index_documents, #update_document, #update_documents
Methods included from DocumentType
#create_document_type, #destroy_document_type, #document_type, #document_types
Methods included from Engine
#create_engine, #destroy_engine, #engine, #engines
Methods included from Search
#search, #search_document_type, #suggest, #suggest_document_type
Methods included from User
Methods included from Request
#delete, #get, #poll, #post, #put, #request
Constructor Details
#initialize(options = {}) ⇒ Client
Create a new Swiftype::Client client
27 28 29 |
# File 'lib/swiftype/client.rb', line 27 def initialize(={}) @options = end |
Class Method Details
Instance Method Details
#api_key ⇒ Object
31 32 33 |
# File 'lib/swiftype/client.rb', line 31 def api_key @options[:api_key] || Swiftype.api_key end |
#open_timeout ⇒ Object
43 44 45 |
# File 'lib/swiftype/client.rb', line 43 def open_timeout @options[:open_timeout] || DEFAULT_TIMEOUT end |
#overall_timeout ⇒ Object
47 48 49 |
# File 'lib/swiftype/client.rb', line 47 def overall_timeout (@options[:overall_timeout] || DEFAULT_TIMEOUT).to_f end |
#platform_access_token ⇒ Object
35 36 37 |
# File 'lib/swiftype/client.rb', line 35 def platform_access_token @options[:platform_access_token] end |
#proxy ⇒ Object
39 40 41 |
# File 'lib/swiftype/client.rb', line 39 def proxy @options[:proxy] end |
#wrap(element) ⇒ Object
51 52 53 |
# File 'lib/swiftype/client.rb', line 51 def wrap(element) [element].flatten(1) end |