Class: ActionView::Helpers::Tags::Translator
- Defined in:
- actionview/lib/action_view/helpers/tags/translator.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(object, object_name, method_and_value, scope:) ⇒ Translator
constructor
A new instance of Translator.
- #translate ⇒ Object
Constructor Details
#initialize(object, object_name, method_and_value, scope:) ⇒ Translator
Returns a new instance of Translator.
7 8 9 10 11 12 |
# File 'actionview/lib/action_view/helpers/tags/translator.rb', line 7 def initialize(object, object_name, method_and_value, scope:) @object_name = object_name.gsub(/\[(.*)_attributes\]\[\d+\]/, '.\1') @method_and_value = method_and_value @scope = scope @model = object.respond_to?(:to_model) ? object.to_model : nil end |