Class: Servactory::Context::Workspace::Actor
- Inherits:
-
Object
- Object
- Servactory::Context::Workspace::Actor
- Defined in:
- lib/servactory/context/workspace.rb
Instance Attribute Summary collapse
-
#class_name ⇒ Object
readonly
Returns the value of attribute class_name.
Instance Method Summary collapse
-
#initialize(context) ⇒ Actor
constructor
A new instance of Actor.
- #translate(key, **options) ⇒ Object
Constructor Details
#initialize(context) ⇒ Actor
Returns a new instance of Actor.
9 10 11 12 |
# File 'lib/servactory/context/workspace.rb', line 9 def initialize(context) @class_name = context.class.name @i18n_root_key = context.config.i18n_root_key end |
Instance Attribute Details
#class_name ⇒ Object (readonly)
Returns the value of attribute class_name.
7 8 9 |
# File 'lib/servactory/context/workspace.rb', line 7 def class_name @class_name end |
Instance Method Details
#translate(key, **options) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/servactory/context/workspace.rb', line 14 def translate(key, **) I18n.t( "#{@i18n_root_key}.#{key}", service_class_name: class_name, ** ) end |