Class: Daytona::Charts::BarData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ BarData

Returns a new instance of BarData.

Parameters:

  • data (Hash<Symbol, Object>)


155
156
157
158
159
# File 'lib/daytona/common/charts.rb', line 155

def initialize(data)
  @label = data.fetch(:label)
  @value = data.fetch(:value)
  @group = data.fetch(:group)
end

Instance Attribute Details

#groupString (readonly)

Returns The group of the bar.

Returns:

  • (String)

    The group of the bar



152
153
154
# File 'lib/daytona/common/charts.rb', line 152

def group
  @group
end

#labelString (readonly)

Returns The label of the bar.

Returns:

  • (String)

    The label of the bar



146
147
148
# File 'lib/daytona/common/charts.rb', line 146

def label
  @label
end

#valueString (readonly)

Returns The value of the bar.

Returns:

  • (String)

    The value of the bar



149
150
151
# File 'lib/daytona/common/charts.rb', line 149

def value
  @value
end

Instance Method Details

#to_hHash<Symbol, Object>

Returns:

  • (Hash<Symbol, Object>)


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

def to_h = { label:, value:, group: }