Class: PhatPgsearch::IndexDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/phat_pgsearch/index_definition.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.extract_options!
  @index_field = args.first
  @fields = []
  instance_eval(&block)
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



3
4
5
# File 'lib/phat_pgsearch/index_definition.rb', line 3

def fields
  @fields
end

#index_fieldObject (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

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/phat_pgsearch/index_definition.rb', line 3

def options
  @options
end

Instance Method Details

#catalogObject



15
16
17
# File 'lib/phat_pgsearch/index_definition.rb', line 15

def catalog
  options[: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