Class: Controll::Notify::Message::Translator
- Inherits:
-
Object
- Object
- Controll::Notify::Message::Translator
- Defined in:
- lib/controll/notify/message/translator.rb
Instance Attribute Summary collapse
-
#caller ⇒ Object
readonly
Returns the value of attribute caller.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(caller, message) ⇒ Translator
constructor
A new instance of Translator.
- #translate ⇒ Object
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, @caller = caller @key = .text @options = ..symbolize_keys end |
Instance Attribute Details
#caller ⇒ Object (readonly)
Returns the value of attribute caller.
5 6 7 |
# File 'lib/controll/notify/message/translator.rb', line 5 def caller @caller end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/controll/notify/message/translator.rb', line 5 def key @key end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/controll/notify/message/translator.rb', line 5 def @options end |
Instance Method Details
#translate ⇒ Object
13 14 15 |
# File 'lib/controll/notify/message/translator.rb', line 13 def translate I18n.t i18n_key, end |