Class: Median::Primo::Facet
- Inherits:
-
Object
- Object
- Median::Primo::Facet
- Includes:
- XmlSupport
- Defined in:
- lib/median/primo/facet.rb
Defined Under Namespace
Classes: FacetValue
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(xml) ⇒ Facet
constructor
A new instance of Facet.
Constructor Details
#initialize(xml) ⇒ Facet
Returns a new instance of Facet.
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/median/primo/facet.rb', line 6 def initialize(xml) super(xml) @values = xml.xpath(".//FACET_VALUES").collect{ |xml| FacetValue.new(xml) } if name == 'creationdate' @values.sort!{ |x, y| y.key <=> x.key } else @values.sort!{ |x, y| y.count <=> x.count } end end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
17 18 19 |
# File 'lib/median/primo/facet.rb', line 17 def values @values end |