Class: Chewy::Repository

Inherits:
Object show all
Includes:
Singleton
Defined in:
lib/chewy/repository.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRepository

Returns a new instance of Repository.


54
55
56
57
58
59
# File 'lib/chewy/repository.rb', line 54

def initialize
  @analyzers = {}
  @tokenizers = {}
  @filters = {}
  @char_filters = {}
end

Instance Attribute Details

#analyzersObject (readonly)

Returns the value of attribute analyzers


5
6
7
# File 'lib/chewy/repository.rb', line 5

def analyzers
  @analyzers
end

#char_filtersObject (readonly)

Returns the value of attribute char_filters


5
6
7
# File 'lib/chewy/repository.rb', line 5

def char_filters
  @char_filters
end

#filtersObject (readonly)

Returns the value of attribute filters


5
6
7
# File 'lib/chewy/repository.rb', line 5

def filters
  @filters
end

#tokenizersObject (readonly)

Returns the value of attribute tokenizers


5
6
7
# File 'lib/chewy/repository.rb', line 5

def tokenizers
  @tokenizers
end

Class Method Details

.delegatedObject


7
8
9
# File 'lib/chewy/repository.rb', line 7

def self.delegated
  public_instance_methods - superclass.public_instance_methods - Singleton.public_instance_methods
end

.repository(name) ⇒ Object


11
12
13
14
15
16
17
18
19
# File 'lib/chewy/repository.rb', line 11

def self.repository(name)
  plural_name = name.to_s.pluralize

  class_eval <<-METHOD, __FILE__, __LINE__ + 1
    def #{name}(name, options = nil)
      options ? #{plural_name}[name.to_sym] = options : #{plural_name}[name.to_sym]
    end
  METHOD
end