Method: Object#_translate

Defined in:
lib/coaster/core_ext/object_translation.rb

#_translate(*args) ⇒ Object

Foo::Bar.new._translate #=> return translation ‘class.Foo.Bar.self’ Foo::Bar.new._translate(‘.title’) #=> return translation ‘class.Foo.Bar.title’ Foo::Bar.new._translate(‘title’) #=> return translation ‘title’ Foo::Bar.new._translate(:force) #=> ignore ‘message’ even if message exists



87
88
89
90
91
92
# File 'lib/coaster/core_ext/object_translation.rb', line 87

def _translate(*args)
  options = (args.last.is_a?(Hash) ? args.pop : {}).with_indifferent_access
  key = args.shift || (respond_to?(:tkey) ? tkey : nil)
  options = _translate_params.merge(options)
  self.class._translate(key, *args, options)
end