Class: SearchApi::Search::SearchAttributeBuilder
- Inherits:
-
Object
- Object
- SearchApi::Search::SearchAttributeBuilder
- Defined in:
- lib/search_api/search.rb
Overview
Describes a search attribute with:
-
a name,
-
some options
-
an optional block
Instance Attribute Summary collapse
-
#block ⇒ Object
block is an optional proc (may be nil).
-
#name ⇒ Object
readonly
name is a search attribute name.
-
#options ⇒ Object
options is an options Hash (never nil, may be empty Hash).
Instance Method Summary collapse
-
#initialize(name, options = {}, &block) ⇒ SearchAttributeBuilder
constructor
A new instance of SearchAttributeBuilder.
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, ={}, &block) @name = name.to_sym @options = @block = block end |
Instance Attribute Details
#block ⇒ Object
block is an optional proc (may be nil)
445 446 447 |
# File 'lib/search_api/search.rb', line 445 def block @block end |
#name ⇒ Object (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 |
#options ⇒ Object
options is an options Hash (never nil, may be empty Hash)
442 443 444 |
# File 'lib/search_api/search.rb', line 442 def @options end |