class LoanCreator::Term

Constants

ARGUMENTS
ATTRIBUTES
OPTIONAL_ARGUMENTS

Public Class Methods

new(**options) click to toggle source
# File lib/loan_creator/term.rb, line 59
def initialize(**options)
  ARGUMENTS.each { |k| instance_variable_set(:"@#{k}", options.fetch(k)) }
  OPTIONAL_ARGUMENTS.each { |k| instance_variable_set(:"@#{k}", options.fetch(k, nil)) }
end

Public Instance Methods

to_csv() click to toggle source
# File lib/loan_creator/term.rb, line 64
def to_csv
  ATTRIBUTES.map { |k| instance_variable_get(:"@#{k}") }.join(',')
end
to_h() click to toggle source
# File lib/loan_creator/term.rb, line 72
def to_h
  ATTRIBUTES.each_with_object({}) { |k, h| h[k] = instance_variable_get(:"@#{k}") }
end
to_s() click to toggle source
# File lib/loan_creator/term.rb, line 68
def to_s
  to_csv
end