Class: String

Inherits:
Object show all
Defined in:
lib/trax/core/ext/string.rb

Instance Method Summary collapse

Instance Method Details

#symbolizeObject



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_wordsObject



10
11
12
# File 'lib/trax/core/ext/string.rb', line 10

def translate_words
  self.split(" ").map(&:translate).join(" ")
end