Class: Chewy::Repository
- Inherits:
-
Object
- Object
- Chewy::Repository
- Includes:
- Singleton
- Defined in:
- lib/chewy/repository.rb
Instance Attribute Summary collapse
-
#analyzers ⇒ Object
readonly
Returns the value of attribute analyzers.
-
#char_filters ⇒ Object
readonly
Returns the value of attribute char_filters.
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
-
#tokenizers ⇒ Object
readonly
Returns the value of attribute tokenizers.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Repository
constructor
A new instance of Repository.
Constructor Details
#initialize ⇒ Repository
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
#analyzers ⇒ Object (readonly)
Returns the value of attribute analyzers.
5 6 7 |
# File 'lib/chewy/repository.rb', line 5 def analyzers @analyzers end |
#char_filters ⇒ Object (readonly)
Returns the value of attribute char_filters.
5 6 7 |
# File 'lib/chewy/repository.rb', line 5 def char_filters @char_filters end |
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
5 6 7 |
# File 'lib/chewy/repository.rb', line 5 def filters @filters end |
#tokenizers ⇒ Object (readonly)
Returns the value of attribute tokenizers.
5 6 7 |
# File 'lib/chewy/repository.rb', line 5 def tokenizers @tokenizers end |
Class Method Details
.delegated ⇒ Object
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 |