Class: Controll::Notify::Message::Translator

Inherits:
Object
  • Object
show all
Defined in:
lib/controll/notify/message/translator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(caller, message) ⇒ Translator

Returns a new instance of Translator.



7
8
9
10
11
# File 'lib/controll/notify/message/translator.rb', line 7

def initialize caller, message
  @caller   = caller
  @key      = message.text
  @options  = message.options.symbolize_keys
end

Instance Attribute Details

#callerObject (readonly)

Returns the value of attribute caller.



5
6
7
# File 'lib/controll/notify/message/translator.rb', line 5

def caller
  @caller
end

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/controll/notify/message/translator.rb', line 5

def key
  @key
end

#optionsObject (readonly)

Returns the value of attribute options.



5
6
7
# File 'lib/controll/notify/message/translator.rb', line 5

def options
  @options
end

Instance Method Details

#translateObject



13
14
15
# File 'lib/controll/notify/message/translator.rb', line 13

def translate
  I18n.t i18n_key, options
end