Module: I18n::Processes::Command::OptionParsers::Locale::Parser

Extended by:
Validator
Defined in:
lib/i18n/processes/command/option_parsers/locale.rb

Constant Summary

Constants included from Validator

Validator::VALID_LOCALE_RE

Class Method Summary collapse

Methods included from Validator

validate!

Class Method Details

.call(val, context) ⇒ Object

Parameters:

  • context (#base_locale, #locales)


25
26
27
28
29
30
31
# File 'lib/i18n/processes/command/option_parsers/locale.rb', line 25

def call(val, context)
  if val.blank? || val == 'base'
    context.base_locale
  else
    validate! val
  end
end