module StringHelper
Public Class Methods
is_i?(word)
click to toggle source
# File lib/string_helper.rb, line 10 def self.is_i?(word) /\A[-+]?\d+\z/ === word end
normalize(word)
click to toggle source
# File lib/string_helper.rb, line 6 def self.normalize(word) underscore(word.sub(/_attributes/, '')) end
underscore(word)
click to toggle source
# File lib/string_helper.rb, line 2 def self.underscore(word) word.split(/(?=[A-Z])/).each { |str| str.downcase! }.join("_") end