module SocialShares::StringHelper
Public Instance Methods
to_camel_case(str)
click to toggle source
# File lib/social_shares/string_helper.rb, line 7 def to_camel_case(str) str.split('_').map(&:capitalize).join end
to_underscore(str)
click to toggle source
# File lib/social_shares/string_helper.rb, line 3 def to_underscore(str) str.dup.tap { |s| (s.gsub!(/(.)([A-Z])/,'\1_\2') || s).downcase! } end