1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 05:25:24 +02:00

Use as_json in TimeSeries

This commit is contained in:
Jose Farias 2024-04-18 20:40:00 -06:00
parent 4ed294eb13
commit 9aa975cc90

View file

@ -37,13 +37,13 @@ class TimeSeries
series: self series: self
end end
# `to_json` returns the data shape used by D3 charts # `as_json` returns the data shape used by D3 charts
def to_json def as_json
{ {
values: values.map(&:as_json), values: values.map(&:as_json),
trend: trend.as_json, trend: trend.as_json,
favorable_direction: favorable_direction favorable_direction: favorable_direction
}.to_json }.as_json
end end
private private