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.
44 45 46 |
# File 'app/services/hyrax/statistics/term_query.rb', line 44 def initialize(label, value) @data = { label: label, data: value } end |
Class Method Details
Instance Method Details
#==(other) ⇒ Object
This enables hash equivalence
57 58 59 |
# File 'app/services/hyrax/statistics/term_query.rb', line 57 def ==(other) other == @data end |
#as_json(opts) ⇒ Object
Allows us to create a Flot charts pie-graph
62 63 64 |
# File 'app/services/hyrax/statistics/term_query.rb', line 62 def as_json(opts) @data.as_json(opts) end |
#label ⇒ Object
48 49 50 |
# File 'app/services/hyrax/statistics/term_query.rb', line 48 def label @data[:label] end |
#value ⇒ Object
52 53 54 |
# File 'app/services/hyrax/statistics/term_query.rb', line 52 def value @data[:data] end |