Sha256: 23bb5e06bae752b06873c4abd9ce326c5f2b17d95e784c6453529e69696c9e28
Contents?: true
Size: 801 Bytes
Versions: 19
Compression:
Stored size: 801 Bytes
Contents
module Myfinance module Entities class ReconcileCollection < Collection def build_collection response.parsed_body.each do |attributes| type = attributes.first if type == "financial_transactions" || type == "financial_accounts" create_collection(type, attributes) end end end private def create_collection(type, attributes) klass = klass_name(type) attributes.delete(attributes.first) attributes.each do |attribute| collection.push(klass.new(attribute.first)) end end def klass_name(type) return Myfinance::Entities::FinancialTransaction if type == "financial_transactions" Myfinance::Entities::FinancialAccount end end end end
Version data entries
19 entries across 19 versions & 1 rubygems