Method: I18n::Inflector::InflectionData_Strict#each_true_token

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

#each_true_token(kind) {|token, description| ... } ⇒ LazyHashEnumerator

Iterates through all the true tokens (not aliases) of the given strict kind.

Parameters:

  • kind (Symbol)

    the identifier of a kind

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:

[View source]

160
161
162
163
164
165
# File 'lib/i18n-inflector/inflection_data_strict.rb', line 160

def each_true_token(kind, &block)
  LazyHashEnumerator.for(@tokens[kind]).
  select { |token,data| data[:target].nil?  }.
  map    { |token,data| data[:description]  }.
  each(&block)
end