Class: PhatPgsearch::IndexDefinition
- Inherits:
-
Object
- Object
- PhatPgsearch::IndexDefinition
- Defined in:
- lib/phat_pgsearch/index_definition.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#index_field ⇒ Object
readonly
Returns the value of attribute index_field.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #catalog ⇒ Object
- #field(*args) ⇒ Object
-
#initialize(*args, &block) ⇒ IndexDefinition
constructor
A new instance of IndexDefinition.
Constructor Details
#initialize(*args, &block) ⇒ IndexDefinition
Returns a new instance of IndexDefinition.
4 5 6 7 8 9 |
# File 'lib/phat_pgsearch/index_definition.rb', line 4 def initialize(*args, &block) @options = args. @index_field = args.first @fields = [] instance_eval(&block) end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
3 4 5 |
# File 'lib/phat_pgsearch/index_definition.rb', line 3 def fields @fields end |
#index_field ⇒ Object (readonly)
Returns the value of attribute index_field.
3 4 5 |
# File 'lib/phat_pgsearch/index_definition.rb', line 3 def index_field @index_field end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/phat_pgsearch/index_definition.rb', line 3 def @options end |
Instance Method Details
#catalog ⇒ Object
15 16 17 |
# File 'lib/phat_pgsearch/index_definition.rb', line 15 def catalog [:catalog] || PhatPgsearch.catalog end |
#field(*args) ⇒ Object
11 12 13 |
# File 'lib/phat_pgsearch/index_definition.rb', line 11 def field(*args) @fields << args end |