Class: CurationConcerns::ChartData::Value

Inherits:
Object
  • Object
show all
Defined in:
app/values/curation_concerns/chart_data.rb

Instance Method Summary collapse

Constructor Details

#initialize(key, value) ⇒ Value

Returns a new instance of Value.



21
22
23
24
# File 'app/values/curation_concerns/chart_data.rb', line 21

def initialize(key, value)
  @key = key
  @value = value
end

Instance Method Details

#drilldown_valueObject



34
35
36
37
38
39
40
41
# File 'app/values/curation_concerns/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_valueObject



26
27
28
29
30
31
32
# File 'app/values/curation_concerns/chart_data.rb', line 26

def series_value
  if @value.is_a?(Hash)
    drilldown_hash
  else
    series_hash
  end
end