class Epics::LetterRenderer
Constants
- I18N_SCOPE
Public Class Methods
Source
# File lib/epics/letter_renderer.rb, line 6 def initialize(client) @client = client end
Public Instance Methods
Source
# File lib/epics/letter_renderer.rb, line 18 def render(bankname) template_path = File.join(File.dirname(__FILE__), '../letter/', template_filename) ERB.new(File.read(template_path)).result(binding) end
Source
# File lib/epics/letter_renderer.rb, line 23 def template_filename use_x_509_certificate_template? ? 'ini_with_certs.erb' : 'ini.erb' end
Source
# File lib/epics/letter_renderer.rb, line 10 def translate(key, **options) I18n.translate(key, **{ locale: @client.locale, scope: I18N_SCOPE }.merge(options)) end
Also aliased as: t
Source
# File lib/epics/letter_renderer.rb, line 27 def use_x_509_certificate_template? x_509_certificate_a_hash && x_509_certificate_x_hash && x_509_certificate_e_hash end
Source
# File lib/epics/letter_renderer.rb, line 31 def x_509_certificate_a_hash @client.x_509_certificate_hash(:a) end
Source
# File lib/epics/letter_renderer.rb, line 39 def x_509_certificate_e_hash @client.x_509_certificate_hash(:e) end
Source
# File lib/epics/letter_renderer.rb, line 35 def x_509_certificate_x_hash @client.x_509_certificate_hash(:x) end