Method: I18n::Inflector::API_Strict#tokens

Defined in:
lib/i18n-inflector/api_strict.rb

#tokens(kind) ⇒ Hash #tokens(kind, locale) ⇒ Hash

Note:

You cannot deduce where aliases are pointing to, since the information about a target is replaced by the description. To get targets use the #raw_tokens method. To simply list aliases and their targets use the #aliases method.

Gets available inflection tokens belonging to a strict kind and their descriptions.

Overloads:

  • #tokens(kind) ⇒ Hash

    Gets available inflection tokens and their descriptions for some kind and the current locale.

    Parameters:

    • kind (Symbol, String)

      the kind of inflection tokens to be returned

    Returns:

    • (Hash)

      the hash containing available inflection tokens (including aliases) as keys and their descriptions as values

  • #tokens(kind, locale) ⇒ Hash

    Gets available inflection tokens and their descriptions of the given kind and locale.

    Parameters:

    • kind (Symbol, String)

      the kind of inflection tokens to be returned

    • locale (Symbol)

      the locale to use

    Returns:

    • (Hash)

      the hash containing available inflection tokens (including aliases) as keys and their descriptions as values

Returns:

  • (Hash)

    the hash containing available inflection tokens and descriptions

Raises:


421
422
423
# File 'lib/i18n-inflector/api_strict.rb', line 421

def tokens(kind=nil, locale=nil)
  each_token(kind, locale).to_h
end