class String

Public Instance Methods

to_camel() click to toggle source
# File lib/pay_u/util/string.rb, line 7
def to_camel
  split("_").inject([]) do |memo, char|
    memo.push(memo.empty? ? char : char.capitalize)
  end.join
end
to_underscore() click to toggle source
# File lib/pay_u/util/string.rb, line 2
def to_underscore
  gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase
end