Class: Daytona::Charts::BarData
- Inherits:
-
Object
- Object
- Daytona::Charts::BarData
- Defined in:
- lib/daytona/common/charts.rb
Instance Attribute Summary collapse
-
#group ⇒ String
readonly
The group of the bar.
-
#label ⇒ String
readonly
The label of the bar.
-
#value ⇒ String
readonly
The value of the bar.
Instance Method Summary collapse
-
#initialize(data) ⇒ BarData
constructor
A new instance of BarData.
- #to_h ⇒ Hash<Symbol, Object>
Constructor Details
#initialize(data) ⇒ BarData
Returns a new instance of BarData.
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
#group ⇒ String (readonly)
Returns The group of the bar.
152 153 154 |
# File 'lib/daytona/common/charts.rb', line 152 def group @group end |
#label ⇒ String (readonly)
Returns The label of the bar.
146 147 148 |
# File 'lib/daytona/common/charts.rb', line 146 def label @label end |
#value ⇒ String (readonly)
Returns The value of the bar.
149 150 151 |
# File 'lib/daytona/common/charts.rb', line 149 def value @value end |
Instance Method Details
#to_h ⇒ Hash<Symbol, Object>
162 |
# File 'lib/daytona/common/charts.rb', line 162 def to_h = { label:, value:, group: } |