Class: Typesensual::Search::Facet

Inherits:
Object
  • Object
show all
Defined in:
lib/typesensual/search/facet.rb

Overview

Represents a facet returned with search results

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, facet) ⇒ Facet

Returns a new instance of Facet.



9
10
11
12
# File 'lib/typesensual/search/facet.rb', line 9

def initialize(key, facet)
  @key = key
  @facet = facet
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



7
8
9
# File 'lib/typesensual/search/facet.rb', line 7

def key
  @key
end

Instance Method Details

#countObject



14
15
16
# File 'lib/typesensual/search/facet.rb', line 14

def count
  @facet['count']
end

#highlightedObject



22
23
24
# File 'lib/typesensual/search/facet.rb', line 22

def highlighted
  @facet['highlighted']
end

#valueObject



18
19
20
# File 'lib/typesensual/search/facet.rb', line 18

def value
  @facet['value']
end