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:
parent
4ed294eb13
commit
9aa975cc90
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue