Class: Swiftype::Document

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/swiftype/document.rb

Instance Method Summary collapse

Methods inherited from BaseModel

collection_name, #create!, #destroy!, #id, #identifier, model_name, parents, #path_to_collection, #path_to_model, #raw_path_to_collection, #raw_path_to_model, #reload, #slugged?, #to_hash, #to_json, #update!, #update_with!

Methods included from Request

#delete, #get, #post, #put

Methods included from Connection

#connection

Instance Method Details

#document_typeObject



9
10
11
# File 'lib/swiftype/document.rb', line 9

def document_type
  DocumentType.find document_type_id
end

#engineObject



5
6
7
# File 'lib/swiftype/document.rb', line 5

def engine
  Engine.find engine_id
end

#update_fields!(hash) ⇒ Object



13
14
15
# File 'lib/swiftype/document.rb', line 13

def update_fields!(hash)
  update_with! put("#{raw_path_to_model}/update_fields.json", {:fields => hash})
end