Class: Hyrax::ChartData
- Inherits:
-
Object
- Object
- Hyrax::ChartData
- Defined in:
- app/values/hyrax/chart_data.rb
Defined Under Namespace
Classes: Value
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #drilldown ⇒ Object
-
#initialize(data) ⇒ ChartData
constructor
A new instance of ChartData.
- #series ⇒ Object
Constructor Details
#initialize(data) ⇒ ChartData
Returns a new instance of ChartData.
5 6 7 |
# File 'app/values/hyrax/chart_data.rb', line 5 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'app/values/hyrax/chart_data.rb', line 4 def data @data end |
Instance Method Details
#drilldown ⇒ Object
9 10 11 12 13 |
# File 'app/values/hyrax/chart_data.rb', line 9 def drilldown data.each_with_object([]) do |(k, v), arr| arr << Value.new(k, v).drilldown_value end.compact end |
#series ⇒ Object
15 16 17 18 19 |
# File 'app/values/hyrax/chart_data.rb', line 15 def series data.each_with_object([]) do |(k, v), arr| arr << Value.new(k, v).series_value end end |