| Module | Amazon |
| In: |
lib/amazon/aws/search.rb
lib/amazon/aws/cache.rb lib/amazon/aws/shoppingcart.rb lib/amazon/locale.rb lib/amazon/aws.rb lib/amazon.rb |
$Id: amazon.rb,v 1.25 2008/10/03 09:35:37 ianmacd Exp $
| NAME | = | 'Ruby/Amazon' |
Prints debugging messages and works like printf, except that it prints only when Ruby is run with the -d switch.
# File lib/amazon.rb, line 16 def Amazon.dprintf(format='', *args) $stderr.printf( format + "\n", *args ) if $DEBUG end
Convert a string from CamelCase to ruby_case.
# File lib/amazon.rb, line 35 def Amazon.uncamelise(str) # Avoid modifying by reference. # str = str.dup # Don't mess with string if all caps. # str.gsub!( /(.+?)(([A-Z][a-z]|[A-Z]+$))/, "\\1_\\2" ) if str =~ /[a-z]/ # Convert to lower case. # str.downcase end