Class: Daytona::Charts::PointData
- Inherits:
-
Object
- Object
- Daytona::Charts::PointData
- Defined in:
- lib/daytona/common/charts.rb
Instance Attribute Summary collapse
-
#label ⇒ String
readonly
The label of the point series.
-
#points ⇒ Array<Array<Object>>
readonly
Array of [x, y] points.
Instance Method Summary collapse
-
#initialize(data) ⇒ PointData
constructor
A new instance of PointData.
-
#to_h ⇒ Hash<Symbol, Object>
Original data representation.
Constructor Details
#initialize(data) ⇒ PointData
Returns a new instance of PointData.
71 72 73 74 |
# File 'lib/daytona/common/charts.rb', line 71 def initialize(data) @label = data.fetch(:label) @points = data.fetch(:points) end |
Instance Attribute Details
#label ⇒ String (readonly)
Returns The label of the point series.
65 66 67 |
# File 'lib/daytona/common/charts.rb', line 65 def label @label end |
#points ⇒ Array<Array<Object>> (readonly)
Returns Array of [x, y] points.
68 69 70 |
# File 'lib/daytona/common/charts.rb', line 68 def points @points end |
Instance Method Details
#to_h ⇒ Hash<Symbol, Object>
Returns original data representation.
77 |
# File 'lib/daytona/common/charts.rb', line 77 def to_h = { label:, points: } |