Class: Daytona::Charts::PointData

Inherits:
Object
  • Object
show all
Defined in:
lib/daytona/common/charts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ PointData

Returns a new instance of PointData.

Parameters:

  • data (Hash<Symbol, Object>)


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

#labelString (readonly)

Returns The label of the point series.

Returns:

  • (String)

    The label of the point series



65
66
67
# File 'lib/daytona/common/charts.rb', line 65

def label
  @label
end

#pointsArray<Array<Object>> (readonly)

Returns Array of [x, y] points.

Returns:

  • (Array<Array<Object>>)

    Array of [x, y] points



68
69
70
# File 'lib/daytona/common/charts.rb', line 68

def points
  @points
end

Instance Method Details

#to_hHash<Symbol, Object>

Returns original data representation.

Returns:

  • (Hash<Symbol, Object>)

    original data representation



77
# File 'lib/daytona/common/charts.rb', line 77

def to_h = { label:, points: }