Method: Elasticsearch::Model::Multimodel#initialize

Defined in:
lib/elasticsearch/model/multimodel.rb

#initialize(*models) ⇒ Multimodel

Returns a new instance of Multimodel.

Parameters:

  • models (Class)

    The list of models across which the search will be performed

[View source]

69
70
71
72
# File 'lib/elasticsearch/model/multimodel.rb', line 69

def initialize(*models)
  @models = models.flatten
  @models = Model::Registry.all if @models.empty?
end