Class: String

Inherits:
Object show all
Defined in:
lib/ruby_archive/handlers/rubyzip/zip/stdrubyext.rb

Overview

:nodoc:all

Instance Method Summary collapse

Instance Method Details

#ends_with(aString) ⇒ Object



40
41
42
# File 'lib/ruby_archive/handlers/rubyzip/zip/stdrubyext.rb', line 40

def ends_with(aString)
  index(aString, -aString.size)
end

#ensure_end(aString) ⇒ Object



44
45
46
# File 'lib/ruby_archive/handlers/rubyzip/zip/stdrubyext.rb', line 44

def ensure_end(aString)
  ends_with(aString) ? self : self + aString
end

#lchopObject



48
49
50
# File 'lib/ruby_archive/handlers/rubyzip/zip/stdrubyext.rb', line 48

def lchop
  slice(1, length)
end

#starts_with(aString) ⇒ Object



36
37
38
# File 'lib/ruby_archive/handlers/rubyzip/zip/stdrubyext.rb', line 36

def starts_with(aString)
  rindex(aString, 0) == 0
end