Class: ForestAdminDatasourceToolkit::Components::Charts::ObjectiveChart
- Inherits:
-
Object
- Object
- ForestAdminDatasourceToolkit::Components::Charts::ObjectiveChart
- Defined in:
- lib/forest_admin_datasource_toolkit/components/charts/objective_chart.rb
Instance Attribute Summary collapse
-
#objective ⇒ Object
readonly
Returns the value of attribute objective.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value, objective = nil) ⇒ ObjectiveChart
constructor
A new instance of ObjectiveChart.
- #serialize ⇒ Object
Constructor Details
#initialize(value, objective = nil) ⇒ ObjectiveChart
Returns a new instance of ObjectiveChart.
7 8 9 10 11 |
# File 'lib/forest_admin_datasource_toolkit/components/charts/objective_chart.rb', line 7 def initialize(value, objective = nil) super() @value = value @objective = objective end |
Instance Attribute Details
#objective ⇒ Object (readonly)
Returns the value of attribute objective.
5 6 7 |
# File 'lib/forest_admin_datasource_toolkit/components/charts/objective_chart.rb', line 5 def objective @objective end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
5 6 7 |
# File 'lib/forest_admin_datasource_toolkit/components/charts/objective_chart.rb', line 5 def value @value end |
Instance Method Details
#serialize ⇒ Object
13 14 15 16 17 18 |
# File 'lib/forest_admin_datasource_toolkit/components/charts/objective_chart.rb', line 13 def serialize result = { value: value } result[:objective] = objective if objective result end |