Class: Servactory::Context::Workspace::Actor

Inherits:
Object
  • Object
show all
Defined in:
lib/servactory/context/workspace.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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, **options)
  I18n.t(
    "#{@i18n_root_key}.#{key}",
    service_class_name: class_name,
    **options
  )
end