Class: Xapit::Client::Facet
- Inherits:
-
Object
- Object
- Xapit::Client::Facet
- Defined in:
- lib/xapit/client/facet.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(attribute, options, applied_facets = []) ⇒ Facet
constructor
A new instance of Facet.
Constructor Details
#initialize(attribute, options, applied_facets = []) ⇒ Facet
Returns a new instance of Facet.
5 6 7 8 |
# File 'lib/xapit/client/facet.rb', line 5 def initialize(attribute, , applied_facets = []) @name = attribute.to_s.gsub("_", " ").gsub(/\b([a-z])/) { $1.to_s.upcase } @options = .map { |option| FacetOption.new(attribute, option, applied_facets) } end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/xapit/client/facet.rb', line 4 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/xapit/client/facet.rb', line 4 def @options end |