Class: Tantiny::Schema
- Inherits:
-
Object
- Object
- Tantiny::Schema
- Defined in:
- lib/tantiny/schema.rb
Instance Attribute Summary collapse
-
#date_fields ⇒ Object
readonly
Returns the value of attribute date_fields.
-
#default_tokenizer ⇒ Object
readonly
Returns the value of attribute default_tokenizer.
-
#double_fields ⇒ Object
readonly
Returns the value of attribute double_fields.
-
#facet_fields ⇒ Object
readonly
Returns the value of attribute facet_fields.
-
#field_tokenizers ⇒ Object
readonly
Returns the value of attribute field_tokenizers.
-
#id_field ⇒ Object
readonly
Returns the value of attribute id_field.
-
#integer_fields ⇒ Object
readonly
Returns the value of attribute integer_fields.
-
#string_fields ⇒ Object
readonly
Returns the value of attribute string_fields.
-
#text_fields ⇒ Object
readonly
Returns the value of attribute text_fields.
Instance Method Summary collapse
-
#initialize(tokenizer, &block) ⇒ Schema
constructor
A new instance of Schema.
- #tokenizer_for(field) ⇒ Object
Constructor Details
#initialize(tokenizer, &block) ⇒ Schema
Returns a new instance of Schema.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/tantiny/schema.rb', line 15 def initialize(tokenizer, &block) @default_tokenizer = tokenizer @id_field = :id @text_fields = [] @string_fields = [] @integer_fields = [] @double_fields = [] @date_fields = [] @facet_fields = [] @field_tokenizers = {} instance_exec(&block) end |
Instance Attribute Details
#date_fields ⇒ Object (readonly)
Returns the value of attribute date_fields.
5 6 7 |
# File 'lib/tantiny/schema.rb', line 5 def date_fields @date_fields end |
#default_tokenizer ⇒ Object (readonly)
Returns the value of attribute default_tokenizer.
5 6 7 |
# File 'lib/tantiny/schema.rb', line 5 def default_tokenizer @default_tokenizer end |
#double_fields ⇒ Object (readonly)
Returns the value of attribute double_fields.
5 6 7 |
# File 'lib/tantiny/schema.rb', line 5 def double_fields @double_fields end |
#facet_fields ⇒ Object (readonly)
Returns the value of attribute facet_fields.
5 6 7 |
# File 'lib/tantiny/schema.rb', line 5 def facet_fields @facet_fields end |
#field_tokenizers ⇒ Object (readonly)
Returns the value of attribute field_tokenizers.
5 6 7 |
# File 'lib/tantiny/schema.rb', line 5 def field_tokenizers @field_tokenizers end |
#id_field ⇒ Object (readonly)
Returns the value of attribute id_field.
5 6 7 |
# File 'lib/tantiny/schema.rb', line 5 def id_field @id_field end |
#integer_fields ⇒ Object (readonly)
Returns the value of attribute integer_fields.
5 6 7 |
# File 'lib/tantiny/schema.rb', line 5 def integer_fields @integer_fields end |
#string_fields ⇒ Object (readonly)
Returns the value of attribute string_fields.
5 6 7 |
# File 'lib/tantiny/schema.rb', line 5 def string_fields @string_fields end |
#text_fields ⇒ Object (readonly)
Returns the value of attribute text_fields.
5 6 7 |
# File 'lib/tantiny/schema.rb', line 5 def text_fields @text_fields end |
Instance Method Details
#tokenizer_for(field) ⇒ Object
29 30 31 |
# File 'lib/tantiny/schema.rb', line 29 def tokenizer_for(field) field_tokenizers[field] || default_tokenizer end |