Class: OPDS::Support::Facet

Inherits:
Link
  • Object
show all
Defined in:
lib/opds/support/linkset.rb

Instance Attribute Summary

Attributes inherited from Link

#browser

Instance Method Summary collapse

Methods inherited from Link

#currency, #inspect, #navigate, #price, #rel, #title, #type, #url

Methods included from Logging

#log, log

Constructor Details

#initialize(array, browser = OPDS::Support::Browser.new) ⇒ Facet

Returns a new instance of Facet.



64
65
66
# File 'lib/opds/support/linkset.rb', line 64

def initialize(array,browser=OPDS::Support::Browser.new) 
	super(array,browser)				
end

Instance Method Details

#active_facetBoolean Also known as: active_facet?

Returns is that facet active.

Returns:

  • (Boolean)

    is that facet active



74
75
76
# File 'lib/opds/support/linkset.rb', line 74

def active_facet
	!self[7].nil?
end

#countInteger

Returns approximate number of entries yield by this facet.

Returns:

  • (Integer)

    approximate number of entries yield by this facet



81
82
83
# File 'lib/opds/support/linkset.rb', line 81

def count
	self[8].to_i
end

#facet_groupString

Returns facet group.

Returns:

  • (String)

    facet group



69
70
71
# File 'lib/opds/support/linkset.rb', line 69

def facet_group
	self[6]
end