Method: I18n::Inflector::InflectionData#each_raw_token
- Defined in:
- lib/i18n-inflector/inflection_data.rb
permalink #each_raw_token ⇒ LazyHashEnumerator #each_raw_token(kind) ⇒ LazyHashEnumerator
Note:
True tokens have descriptions (String) and aliases have targets (Symbol) assigned.
Iterates through all the tokens in a way that it is possible to distinguish true tokens from aliases.
220 221 222 223 224 225 |
# File 'lib/i18n-inflector/inflection_data.rb', line 220 def each_raw_token(kind=nil, &block) t = @lazy_tokens t = t.select { |token,data| data[:kind] == kind } unless kind.nil? t.map { |token,data| data[:target] || data[:description] }. each(&block) end |