Class: Hyrax::ChartData::Value
- Inherits:
-
Object
- Object
- Hyrax::ChartData::Value
- Defined in:
- app/values/hyrax/chart_data.rb
Instance Method Summary collapse
- #drilldown_value ⇒ Object
-
#initialize(key, value) ⇒ Value
constructor
A new instance of Value.
- #series_value ⇒ Object
Constructor Details
#initialize(key, value) ⇒ Value
Returns a new instance of Value.
22 23 24 25 |
# File 'app/values/hyrax/chart_data.rb', line 22 def initialize(key, value) @key = key @value = value end |
Instance Method Details
#drilldown_value ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'app/values/hyrax/chart_data.rb', line 35 def drilldown_value return nil unless @value.is_a?(Hash) { name: @key, id: @key, data: @value.to_a } end |
#series_value ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/values/hyrax/chart_data.rb', line 27 def series_value if @value.is_a?(Hash) drilldown_hash else series_hash end end |