Class: ApexCharts::Series::BubbleSeries
- Inherits:
-
Object
- Object
- ApexCharts::Series::BubbleSeries
- Includes:
- Utils::Copy
- Defined in:
- lib/apex_charts/series/bubble_series.rb
Instance Attribute Summary collapse
-
#sanitized ⇒ Object
readonly
Returns the value of attribute sanitized.
Instance Method Summary collapse
-
#initialize(data) ⇒ BubbleSeries
constructor
A new instance of BubbleSeries.
- #sample ⇒ Object
Methods included from Utils::Copy
Constructor Details
#initialize(data) ⇒ BubbleSeries
Returns a new instance of BubbleSeries.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/apex_charts/series/bubble_series.rb', line 11 def initialize(data) data = deep_copy(data) sanitized = case data when Array if array_of_threes?(data) [{data: data}] else data end when Hash if data_value = data[:data] [data] if array_of_threes?(data_value) end end @sanitized = {series: sanitized} end |
Instance Attribute Details
#sanitized ⇒ Object (readonly)
Returns the value of attribute sanitized.
9 10 11 |
# File 'lib/apex_charts/series/bubble_series.rb', line 9 def sanitized @sanitized end |
Instance Method Details
#sample ⇒ Object
32 33 34 35 36 |
# File 'lib/apex_charts/series/bubble_series.rb', line 32 def sample return if empty? sanitized[:series][0][:data][0] end |