Class: Daytona::Charts::PieData
- Inherits:
-
Object
- Object
- Daytona::Charts::PieData
- Defined in:
- lib/daytona/common/charts.rb
Instance Attribute Summary collapse
-
#angle ⇒ Float
readonly
The angle of the pie slice.
-
#autopct ⇒ Float
readonly
The autopct value of the pie slice.
-
#label ⇒ String
readonly
The label of the pie slice.
-
#radius ⇒ Float
readonly
The radius of the pie slice.
Instance Method Summary collapse
-
#initialize(data) ⇒ PieData
constructor
A new instance of PieData.
- #to_h ⇒ Hash<Symbol, Object>
Constructor Details
#initialize(data) ⇒ PieData
Returns a new instance of PieData.
194 195 196 197 198 199 |
# File 'lib/daytona/common/charts.rb', line 194 def initialize(data) @label = data.fetch(:label) @angle = data.fetch(:angle) @radius = data.fetch(:radius) @autopct = data.fetch(:autopct) end |
Instance Attribute Details
#angle ⇒ Float (readonly)
Returns The angle of the pie slice.
185 186 187 |
# File 'lib/daytona/common/charts.rb', line 185 def angle @angle end |
#autopct ⇒ Float (readonly)
Returns The autopct value of the pie slice.
191 192 193 |
# File 'lib/daytona/common/charts.rb', line 191 def autopct @autopct end |
#label ⇒ String (readonly)
Returns The label of the pie slice.
182 183 184 |
# File 'lib/daytona/common/charts.rb', line 182 def label @label end |
#radius ⇒ Float (readonly)
Returns The radius of the pie slice.
188 189 190 |
# File 'lib/daytona/common/charts.rb', line 188 def radius @radius end |
Instance Method Details
#to_h ⇒ Hash<Symbol, Object>
202 |
# File 'lib/daytona/common/charts.rb', line 202 def to_h = { label:, angle:, radius:, autopct: } |