Method: I18n::Inflector::InflectionData_Strict#each_token

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

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

Note:

Use #each_raw_token if you want to distinguish true tokens from aliases.

Iterates through all the tokens (including 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]

211
212
213
214
215
# File 'lib/i18n-inflector/inflection_data_strict.rb', line 211

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