Sha256: f48f453c08c8ac15d1a3f037e1352bf1860f3801c864a8d2ef61b577c81c916e

Contents?: true

Size: 528 Bytes

Versions: 3

Compression:

Stored size: 528 Bytes

Contents

class Epics::LetterRenderer
  extend Forwardable

  TEMPLATE_PATH = File.join(File.dirname(__FILE__), '../letter/', 'ini.erb')
  I18N_SCOPE = 'epics.letter'

  def initialize(client)
    @client = client
  end

  def translate(key, **options)
    I18n.translate(key, **{ locale: @client.locale, scope: I18N_SCOPE }.merge(options))
  end

  alias_method :t, :translate

  def_delegators :@client, :host_id, :user_id, :partner_id, :a, :x, :e

  def render(bankname)
    ERB.new(File.read(TEMPLATE_PATH)).result(binding)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
epics-2.7.0 lib/epics/letter_renderer.rb
epics-2.6.0 lib/epics/letter_renderer.rb
epics-2.5.0 lib/epics/letter_renderer.rb