Sha256: 1199781d3a9a006aa105f6f67e86f670e4a8193b1df3d6a2fe0fd196e7b80018

Contents?: true

Size: 242 Bytes

Versions: 14

Compression:

Stored size: 242 Bytes

Contents

class String
  def symbolize
    self.try_chain(:demodulize, :underscore, :to_sym)
  end

  def translate(*args)
    I18n.translate(self.underscore, *args)
  end

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

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
trax_core-0.0.86 lib/trax/core/ext/string.rb
trax_core-0.0.85 lib/trax/core/ext/string.rb
trax_core-0.0.84 lib/trax/core/ext/string.rb
trax_core-0.0.83 lib/trax/core/ext/string.rb
trax_core-0.0.82 lib/trax/core/ext/string.rb
trax_core-0.0.81 lib/trax/core/ext/string.rb
trax_core-0.0.80 lib/trax/core/ext/string.rb
trax_core-0.0.79 lib/trax/core/ext/string.rb
trax_core-0.0.78 lib/trax/core/ext/string.rb
trax_core-0.0.77 lib/trax/core/ext/string.rb
trax_core-0.0.76 lib/trax/core/ext/string.rb
trax_core-0.0.74 lib/trax/core/ext/string.rb
trax_core-0.0.73 lib/trax/core/ext/string.rb
trax_core-0.0.72 lib/trax/core/ext/string.rb