Method: I18n::Inflector::API_Strict#each_token_true

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

#each_token_true(kind) ⇒ LazyHashEnumerator #each_token_true(kind, locale) ⇒ LazyHashEnumerator Also known as: each_true_token

Note:

It returns only true tokens, not aliases.

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

Overloads:

  • #each_token_true(kind) ⇒ LazyHashEnumerator

    Iterates through true 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_true(kind, locale) ⇒ LazyHashEnumerator

    Iterates through true 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, description)

    optional block in which each token will be yielded

Yield Parameters:

  • token (Symbol)

    a token

  • description (String)

    a description string for a token

Yield Returns:

Returns:

Raises:

[View source]

498
499
500
501
# File 'lib/i18n-inflector/api_strict.rb', line 498

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