Class: DNZ::Facet
- Inherits:
-
Object
- Object
- DNZ::Facet
- Defined in:
- lib/dnz/facet.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#search ⇒ Object
readonly
Returns the value of attribute search.
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(client, search, doc) ⇒ Facet
constructor
A new instance of Facet.
Constructor Details
#initialize(client, search, doc) ⇒ Facet
Returns a new instance of Facet.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/dnz/facet.rb', line 20 def initialize(client, search, doc) @name = doc.xpath('facet-field').text @values = [] @search = search doc.xpath('values').first.children.each do |value_doc| value = DNZ::FacetValue.new(client, self, value_doc) @values << value if value.valid? end end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
16 17 18 |
# File 'lib/dnz/facet.rb', line 16 def name @name end |
#search ⇒ Object (readonly)
Returns the value of attribute search.
18 19 20 |
# File 'lib/dnz/facet.rb', line 18 def search @search end |
#values ⇒ Object (readonly)
Returns the value of attribute values.
17 18 19 |
# File 'lib/dnz/facet.rb', line 17 def values @values end |