mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-25 08:09:38 +02:00
Add loan and credit card views (#1268)
* Add loan and credit card views * Lint fix * Clean up overview card markup * Lint fix * Test fix
This commit is contained in:
parent
9263dd3bbe
commit
fd941d714d
34 changed files with 564 additions and 102 deletions
|
@ -3,14 +3,14 @@ class TimeSeries
|
|||
|
||||
attr_reader :values, :favorable_direction
|
||||
|
||||
def self.from_collection(collection, value_method)
|
||||
def self.from_collection(collection, value_method, favorable_direction: "up")
|
||||
collection.map do |obj|
|
||||
{
|
||||
date: obj.date,
|
||||
value: obj.public_send(value_method),
|
||||
original: obj
|
||||
}
|
||||
end.then { |data| new(data) }
|
||||
end.then { |data| new(data, favorable_direction: favorable_direction) }
|
||||
end
|
||||
|
||||
def initialize(data, favorable_direction: "up")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue