Class: BlacklightFacetExtras::Range::FacetItem

Inherits:
FacetItem
  • Object
show all
Defined in:
lib/blacklight_facet_extras/range.rb

Instance Attribute Summary collapse

Attributes inherited from FacetItem

#display_label

Instance Method Summary collapse

Constructor Details

#initialize(value, hits, opts = {}) ⇒ FacetItem

Returns a new instance of FacetItem.



7
8
9
10
11
# File 'lib/blacklight_facet_extras/range.rb', line 7

def initialize value, hits, opts = {}
  super(value, hits, opts = {})
  @from = opts[:from]
  @to = opts[:to]
end

Instance Attribute Details

#fromObject

Returns the value of attribute from.



5
6
7
# File 'lib/blacklight_facet_extras/range.rb', line 5

def from
  @from
end

#toObject

Returns the value of attribute to.



5
6
7
# File 'lib/blacklight_facet_extras/range.rb', line 5

def to
  @to
end

Instance Method Details

#valueObject



13
14
15
16
# File 'lib/blacklight_facet_extras/range.rb', line 13

def value
  return"[#{self.from} TO #{self.to}]" if self.from and self.to
  super
end