Class: Hyrax::Statistics::TermQuery::Result
- Inherits:
-
Object
- Object
- Hyrax::Statistics::TermQuery::Result
- Defined in:
- app/services/hyrax/statistics/term_query.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#==(other) ⇒ Object
This enables hash equivalence.
-
#as_json(opts) ⇒ Object
Allows us to create a Flot charts pie-graph.
-
#initialize(label, value) ⇒ Result
constructor
A new instance of Result.
- #label ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(label, value) ⇒ Result
Returns a new instance of Result.
42 43 44 |
# File 'app/services/hyrax/statistics/term_query.rb', line 42 def initialize(label, value) @data = { label: label, data: value } end |
Class Method Details
Instance Method Details
#==(other) ⇒ Object
This enables hash equivalence
55 56 57 |
# File 'app/services/hyrax/statistics/term_query.rb', line 55 def ==(other) other == @data end |
#as_json(opts) ⇒ Object
Allows us to create a Flot charts pie-graph
60 61 62 |
# File 'app/services/hyrax/statistics/term_query.rb', line 60 def as_json(opts) @data.as_json(opts) end |
#label ⇒ Object
46 47 48 |
# File 'app/services/hyrax/statistics/term_query.rb', line 46 def label @data[:label] end |
#value ⇒ Object
50 51 52 |
# File 'app/services/hyrax/statistics/term_query.rb', line 50 def value @data[:data] end |