module RakutenWebService::StringSupport
Public Instance Methods
to_camel()
click to toggle source
# File lib/rakuten_web_service/string_support.rb, line 10 def to_camel gsub(/([a-z]{1})_([a-z]{1})/) do |matched| matched = matched.split('_') matched[0] + matched[1].capitalize end end
to_snake()
click to toggle source
# File lib/rakuten_web_service/string_support.rb, line 6 def to_snake gsub(/([a-z]+)([A-Z]{1})/, '\1_\2').downcase end