Sha256: bf035abb7aa979466ceb8a6bab0cc8c5a99aba552fac5a53a3251c96c729d00d

Contents?: true

Size: 217 Bytes

Versions: 6

Compression:

Stored size: 217 Bytes

Contents

class String

  # Converts a snake_case string to CamelCase
  #
  # @return [String]
  def camelize
    self.gsub(/\/(.?)/){"::#{$1.upcase}"}.gsub(/(?:^|_)(.)/){$1.upcase}
  end unless method_defined?(:camelize)

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
twitter-4.3.0 lib/twitter/core_ext/string.rb
twitter-4.2.0 lib/twitter/core_ext/string.rb
twitter-4.1.2 lib/twitter/core_ext/string.rb
twitter-4.1.1 lib/twitter/core_ext/string.rb
twitter-4.1.0 lib/twitter/core_ext/string.rb
twitter-4.0.0 lib/twitter/core_ext/string.rb