Method: Mobility.normalize_locale_accessor
- Defined in:
- lib/mobility.rb
.normalize_locale_accessor(attribute, locale = Mobility.locale) ⇒ String
Return normalized locale accessor name
198 199 200 201 202 203 204 |
# File 'lib/mobility.rb', line 198 def normalize_locale_accessor(attribute, locale = Mobility.locale) "#{attribute}_#{normalize_locale(locale)}".tap do |accessor| unless CALL_COMPILABLE_REGEXP.match(accessor) raise ArgumentError, "#{accessor.inspect} is not a valid accessor" end end end |