Sha256: de765d503746b61f076cebe824725fdc730f0eb39d58778d1683590b7fc7716c

Contents?: true

Size: 276 Bytes

Versions: 11

Compression:

Stored size: 276 Bytes

Contents

# this is a monkey patching over the String class 
# to bring the camelcase method from rails
class String

  # the famous camelize method so useful in metaprogramming
  def camelize
    self.downcase!
    self.gsub!(/(?:_| )?(.)([^_ ]*)/) { "#{$1.upcase}#{$2}" }
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
cogbot-0.1.14 lib/cogbot/utils.rb
cogbot-0.1.13 lib/cogbot/utils.rb
cogbot-0.1.12 lib/cogbot/utils.rb
cogbot-0.1.11 lib/cogbot/utils.rb
cogbot-0.1.10 lib/cogbot/utils.rb
cogbot-0.1.9 lib/cogbot/utils.rb
cogbot-0.1.7 lib/cogbot/utils.rb
cogbot-0.1.6 lib/cogbot/utils.rb
cogbot-0.1.5 lib/cogbot/utils.rb
cogbot-0.1.4 lib/cogbot/utils.rb
cogbot-0.1.3 lib/cogbot/utils.rb