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.
21 22 23 24 |
# File 'app/values/hyrax/chart_data.rb', line 21 def initialize(key, value) @key = key @value = value end |
Instance Method Details
#drilldown_value ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'app/values/hyrax/chart_data.rb', line 34 def drilldown_value return nil unless @value.is_a?(Hash) { name: @key, id: @key, data: @value.to_a } end |
#series_value ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/values/hyrax/chart_data.rb', line 26 def series_value if @value.is_a?(Hash) drilldown_hash else series_hash end end |