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