Class: String
Instance Method Summary collapse
Instance Method Details
#symbolize ⇒ Object
2 3 4 |
# File 'lib/trax/core/ext/string.rb', line 2 def symbolize self.try_chain(:demodulize, :underscore, :to_sym) end |
#translate(*args) ⇒ Object
6 7 8 |
# File 'lib/trax/core/ext/string.rb', line 6 def translate(*args) I18n.translate(self.underscore, *args) end |
#translate_words ⇒ Object
10 11 12 |
# File 'lib/trax/core/ext/string.rb', line 10 def translate_words self.split(" ").map(&:translate).join(" ") end |