Skip to content

Commit

Permalink
Add documentation on facets related methods
Browse files Browse the repository at this point in the history
  • Loading branch information
zetaben committed Jun 13, 2011
1 parent 3e1fa06 commit 57934eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/opds/acquisition_feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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={}
Expand All @@ -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={}
Expand Down
3 changes: 3 additions & 0 deletions lib/opds/support/linkset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 57934eb

Please sign in to comment.