Method: FoxTail::Translator#initialize
- Defined in:
- lib/fox_tail/translator.rb
#initialize(object, object_name, method, options = {}) ⇒ Translator
Returns a new instance of Translator.
7 8 9 10 11 12 13 14 |
# File 'lib/fox_tail/translator.rb', line 7 def initialize(object, object_name, method, = {}) @model = object.respond_to?(:to_model) ? object.to_model : nil @object_name = object_name.gsub(/\[(.*)_attributes\]\[\d+\]/, '.\1') @method = method @value = [:value] @scope = [:scope] @default_value = .fetch(:default, "") end |