Method: I18n::Inflector::API_Strict#each_token_raw

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

#each_token_raw(kind) ⇒ LazyHashEnumerator #each_token_raw(kind, locale) ⇒ LazyHashEnumerator Also known as: each_raw_token

Note:

You may deduce whether the returned values are aliases or true tokens by testing if a value is a kind of Symbol or a String.

Iterates through available inflection tokens belonging to a strict kind and their values.

Overloads:

  • #each_token_raw(kind) ⇒ LazyHashEnumerator

    Iterates through available inflection tokens and their values of the given kind and the current locale.

    Parameters:

    • kind (Symbol, String)

      the kind of inflection tokens to be returned

    Returns:

  • #each_token_raw(kind, locale) ⇒ LazyHashEnumerator

    Iterates through available inflection tokens (and their values) 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:

Yields:

  • (token, value)

    optional block in which each token will be yielded

Yield Parameters:

  • token (Symbol)

    a token

  • value (Symbol, String)

    a description string for a token or a target (if alias)

Yield Returns:

Returns:

Raises:

[View source]

446
447
448
449
# File 'lib/i18n-inflector/api_strict.rb', line 446

def each_token_raw(kind=nil, locale=nil, &block)
  kind = kind.to_s.empty? ? nil : kind.to_sym
  data_safe(locale).each_raw_token(kind, &block)
end