Method: Elasticsearch::Persistence::Repository::DSL::ClassMethods#klass

Defined in:
lib/elasticsearch/persistence/repository/dsl.rb

#klass(_class = nil) ⇒ Class

Get or set the class-level setting for the class used by the repository when deserializing.

Examples:

MyRepository.klass

Returns:

  • (Class)

    _class The repository’s klass for deserializing.

Since:

  • 6.0.0


56
57
58
# File 'lib/elasticsearch/persistence/repository/dsl.rb', line 56

def klass(_class = nil)
  instance_variables.include?(:@klass) ? @klass : @klass = _class
end