diff --git a/lib/opds/acquisition_feed.rb b/lib/opds/acquisition_feed.rb index 4118fed..1e802b3 100644 --- a/lib/opds/acquisition_feed.rb +++ b/lib/opds/acquisition_feed.rb @@ -2,6 +2,9 @@ module OPDS # Represents an acquisition feed # @see http://opds-spec.org/specs/opds-catalog-1-0-20100830/#Acquisition_Feeds class AcquisitionFeed < Feed + + # Get a collection of facets groupped by opds:facetGroup + # @return [Hash] facets def facets return @facets if @facets @facets={} @@ -12,6 +15,9 @@ def facets @facets end + + # Get a collection of active_facets by opds:facetGroup + # @return [Hash] active facets def active_facets return @selected if @selected @selected={} diff --git a/lib/opds/support/linkset.rb b/lib/opds/support/linkset.rb index 5b551d6..eacdd00 100644 --- a/lib/opds/support/linkset.rb +++ b/lib/opds/support/linkset.rb @@ -65,16 +65,19 @@ def initialize(array,browser=OPDS::Support::Browser.new) super(array,browser) end + #@return [String] facet group def facet_group self[6] end + #@return [Boolean] is that facet active def active_facet !self[7].nil? end alias :active_facet? :active_facet + #@return [Integer] approximate number of entries yield by this facet def count self[8].to_i end