Class: SearchApi::Search::SearchAttributeBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/search_api/search.rb

Overview

Describes a search attribute with:

  • a name,

  • some options

  • an optional block

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}, &block) ⇒ SearchAttributeBuilder

Returns a new instance of SearchAttributeBuilder.



447
448
449
450
451
# File 'lib/search_api/search.rb', line 447

def initialize(name, options={}, &block)
  @name = name.to_sym
  @options = options
  @block = block
end

Instance Attribute Details

#blockObject

block is an optional proc (may be nil)



445
446
447
# File 'lib/search_api/search.rb', line 445

def block
  @block
end

#nameObject (readonly)

name is a search attribute name. It is read-only so that SearchApi::Bridge::Base.rewrite_search_attribute_builder is unable to rename attributes.



439
440
441
# File 'lib/search_api/search.rb', line 439

def name
  @name
end

#optionsObject

options is an options Hash (never nil, may be empty Hash)



442
443
444
# File 'lib/search_api/search.rb', line 442

def options
  @options
end