Method: I18n::Inflector::InflectionData#add_token
- Defined in:
- lib/i18n-inflector/inflection_data.rb
permalink #add_token(token, kind, description) ⇒ Boolean
Adds a token (overwriting existing token).
71 72 73 74 75 76 77 78 |
# File 'lib/i18n-inflector/inflection_data.rb', line 71 def add_token(token, kind, description) return false if (token.to_s.empty? || kind.to_s.empty? || description.nil?) token = token.to_sym @tokens[token] = {} @tokens[token][:kind] = kind.to_sym @tokens[token][:description] = description.to_s @kinds[kind] = true end |