Method: I18n::Inflector::API_Strict#tkl_args
- Defined in:
- lib/i18n-inflector/api_strict.rb
#tkl_args(token, kind, locale) ⇒ Array<Symbol,Symbol,Symbol> (protected) #tkl_args(token, kind) ⇒ Array<Symbol,Symbol,Symbol> (protected) #tkl_args(token) ⇒ Array<Symbol,Symbol,Symbol> (protected)
This method is the internal helper that prepares arguments containing token
, kind
and locale
.
632 633 634 635 636 637 638 639 640 641 642 |
# File 'lib/i18n-inflector/api_strict.rb', line 632 def tkl_args(args) token, kind, locale = case args.count when 1 then [args[0], nil, nil] when 2 then [args[0], args[1], nil] when 3 then args else raise I18n::ArgumentError.new("wrong number of arguments: #{args.count} for (1..3)") end token = token.nil? || token.to_s.empty? ? nil : token.to_sym kind = kind.nil? || kind.to_s.empty? ? nil : kind.to_sym [token,kind,locale] end |