Class: Zaala::API::InstallmentPlan

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/zaala/api/types.rb

Class Method Summary collapse

Class Method Details

.from_message(h) ⇒ Object



536
537
538
539
540
541
542
543
544
# File 'lib/zaala/api/types.rb', line 536

def self.from_message(h)
  InstallmentPlan.new({
    total_rate_amount: h[:totalRateAmount],
    interest_rate: h[:interestRate],
    billing_date: h[:billingDate],
    rate_model: h[:rateModel],
    rates: h[:rates] ? h[:rates].map { |r| Rate.from_message(r) } : [],
  })
end