lib/amazon_product_advertising_api/support.rb
# Converts strings from CamelCase format to under_score.
Converts strings from CamelCase format to under_score.
Converts strings from CamelCase format to under_score .
def underscore
        self.to_s.gsub(/::/, '/').
          gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
          gsub(/([a-z\d])([A-Z])/,'\1_\2').
          tr("-", "_").
          downcase
      end
def underscore self . to_s . gsub ( / :: / , '/' ) . gsub ( / ([A-Z]+)([A-Z][a-z]) / , '\1_\2' ) . gsub ( / ([a-z \d ])([A-Z]) / , '\1_\2' ) . tr ( "-" , "_" ) . downcase end
Converts strings from CamelCase format to under_score.
Converts strings from CamelCase format to under_score .