Class: SearchMagic::Breadcrumb
- Inherits:
-
Object
- Object
- SearchMagic::Breadcrumb
- Defined in:
- lib/search_magic/breadcrumb.rb
Instance Attribute Summary collapse
-
#field_name ⇒ Object
Returns the value of attribute field_name.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(field_name, options) ⇒ Breadcrumb
constructor
A new instance of Breadcrumb.
- #term ⇒ Object
Constructor Details
#initialize(field_name, options) ⇒ Breadcrumb
Returns a new instance of Breadcrumb.
5 6 7 8 9 10 |
# File 'lib/search_magic/breadcrumb.rb', line 5 def initialize(field_name, ) self.field_name = field_name self. = self.[:except] = Array.wrap(self.[:except]).compact self.[:only] = Array.wrap(self.[:only]).compact end |
Instance Attribute Details
#field_name ⇒ Object
Returns the value of attribute field_name.
3 4 5 |
# File 'lib/search_magic/breadcrumb.rb', line 3 def field_name @field_name end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/search_magic/breadcrumb.rb', line 3 def @options end |
Instance Method Details
#clone ⇒ Object
16 17 18 |
# File 'lib/search_magic/breadcrumb.rb', line 16 def clone Breadcrumb.new(field_name, ) end |
#term ⇒ Object
12 13 14 |
# File 'lib/search_magic/breadcrumb.rb', line 12 def term @term ||= [:skip_prefix].presence ? nil : ([:as] || field_name.to_s.pluralize.singularize).to_sym end |