Module: Swiftype::Client::DocumentType

Included in:
Swiftype::Client
Defined in:
lib/swiftype/client.rb

Overview

Every Document must belong to a DocumentType. For more information, see the REST API overview.

Instance Method Summary collapse

Instance Method Details

#create_document_type(engine_id, name) ⇒ Object


269
270
271
# File 'lib/swiftype/client.rb', line 269

def create_document_type(engine_id, name)
  post("engines/#{engine_id}/document_types.json", :document_type => {:name => name})
end

#destroy_document_type(engine_id, document_type_id) ⇒ Object


273
274
275
# File 'lib/swiftype/client.rb', line 273

def destroy_document_type(engine_id, document_type_id)
  delete("engines/#{engine_id}/document_types/#{document_type_id}.json")
end

#document_type(engine_id, document_type_id) ⇒ Object


265
266
267
# File 'lib/swiftype/client.rb', line 265

def document_type(engine_id, document_type_id)
  get("engines/#{engine_id}/document_types/#{document_type_id}.json")
end

#document_types(engine_id) ⇒ Object


261
262
263
# File 'lib/swiftype/client.rb', line 261

def document_types(engine_id)
  get("engines/#{engine_id}/document_types.json")
end