Sha256: c57b8ddfbc75728b30abd4176510f2f60b6f7005ad8acc91bde4b6cd19c8af95

Contents?: true

Size: 385 Bytes

Versions: 6

Compression:

Stored size: 385 Bytes

Contents

# A small utility library.
#--
# Copyright 2006 Suraj N. Kurapati
# See the file named LICENSE for details.

class String
  # Converts this string into a valid Ruby constant name.
  def to_ruby_const_name
    self[0, 1].upcase << self[1..-1]
  end

  # Strips off everything after the given character in this string.
  def rstrip_from char
    sub(/#{char}[^#{char}]*$/, '')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-vpi-18.0.1 lib/ruby-vpi/util.rb
ruby-vpi-19.0.0 lib/ruby-vpi/util.rb
ruby-vpi-18.0.2 lib/ruby-vpi/util.rb
ruby-vpi-20.0.0 lib/ruby-vpi/util.rb
ruby-vpi-21.0.0 lib/ruby-vpi/util.rb
ruby-vpi-21.1.0 lib/ruby-vpi/util.rb