module I18n::Object::TranslationMethods::ClassMethods
Public Instance Methods
scope()
click to toggle source
# File lib/i18n/object/translation_methods.rb, line 11 def scope @scope end
scope=(value)
click to toggle source
# File lib/i18n/object/translation_methods.rb, line 15 def scope=(value) @scope = value end
Private Instance Methods
method_missing(method_name, *args, &block)
click to toggle source
Calls superclass method
# File lib/i18n/object/translation_methods.rb, line 25 def method_missing(method_name, *args, &block) translate(method_name, args) || super end
respond_to_missing?(method_name, *args)
click to toggle source
Calls superclass method
# File lib/i18n/object/translation_methods.rb, line 21 def respond_to_missing?(method_name, *args) !!translate(method_name, args) || super end
translate(method_name, args)
click to toggle source
# File lib/i18n/object/translation_methods.rb, line 29 def translate(method_name, args) options = args.first || {} ::I18n.t!(method_name, **options.merge(scope: scope)) rescue ::I18n::MissingTranslationData nil end