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.
4 5 6 |
# File 'app/values/hyrax/chart_data.rb', line 4 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'app/values/hyrax/chart_data.rb', line 3 def data @data end |
Instance Method Details
#drilldown ⇒ Object
8 9 10 11 12 |
# File 'app/values/hyrax/chart_data.rb', line 8 def drilldown data.each_with_object([]) do |(k, v), arr| arr << Value.new(k, v).drilldown_value end.compact end |
#series ⇒ Object
14 15 16 17 18 |
# File 'app/values/hyrax/chart_data.rb', line 14 def series data.each_with_object([]) do |(k, v), arr| arr << Value.new(k, v).series_value end end |