module QRBills
Public Class Methods
create_creditor_reference(reference)
click to toggle source
# File lib/qr-bills.rb, line 31 def self.create_creditor_reference(reference) QRCreditorReference.create(reference) end
generate(qr_params)
click to toggle source
# File lib/qr-bills.rb, line 8 def self.generate(qr_params) raise ArgumentError, "#{QRExceptions::INVALID_PARAMETERS}: bill type param not set" unless qr_params.has_key?(:bill_type) raise ArgumentError, "#{QRExceptions::INVALID_PARAMETERS}: validation failed" unless QRParams.valid?(qr_params) # init translator sets %i[it en de fr].each do |locale| locale_file = File.join(qr_params[:locales][:path], "qrbills.#{locale}.yml") I18n.load_path << locale_file end output = case qr_params[:output_params][:format] when 'html' QRHTMLLayout.create(qr_params) when 'qrcode_png' QRGenerator.create(qr_params, qr_params[:qrcode_filepath]) else raise ArgumentError, "#{QRExceptions::NOT_SUPPORTED}: #{qr_params[:output_params][:format]} is not yet supported" end { params: qr_params, output: output } end
get_qr_params()
click to toggle source
# File lib/qr-bills.rb, line 35 def self.get_qr_params QRParams.get_qr_params end
get_qrbill_with_creditor_reference_type()
click to toggle source
# File lib/qr-bills.rb, line 43 def self.get_qrbill_with_creditor_reference_type QRParams::QR_BILL_WITH_CREDITOR_REFERENCE end
get_qrbill_with_qr_reference_type()
click to toggle source
# File lib/qr-bills.rb, line 39 def self.get_qrbill_with_qr_reference_type QRParams::QR_BILL_WITH_QR_REFERENCE end
get_qrbill_without_reference_type()
click to toggle source
# File lib/qr-bills.rb, line 47 def self.get_qrbill_without_reference_type QRParams::QR_BILL_WITOUTH_REFERENCE end