lib/linked_in/mash.rb
# borrowed from ActiveSupport
# no need require an entire lib when we only need one method
borrowed from ActiveSupport
no need require an entire lib when we only need one method
borrowed from ActiveSupport no need require an entire lib when we only need one method
def underscore(camel_cased_word)
        word = camel_cased_word.to_s.dup
        word.gsub!(/::/, '/')
        word.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
        word.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
        word.tr!("-", "_")
        word.downcase!
        word
      end
def underscore ( camel_cased_word ) word = camel_cased_word . to_s . dup word . gsub! ( / :: / , '/' ) word . gsub! ( / ([A-Z]+)([A-Z][a-z]) / , '\1_\2' ) word . gsub! ( / ([a-z \d ])([A-Z]) / , '\1_\2' ) word . tr! ( "-" , "_" ) word . downcase! word end
borrowed from ActiveSupport
no need require an entire lib when we only need one method
borrowed from ActiveSupport no need require an entire lib when we only need one method
camel_cased_word
<not_specific>