Class: String

Inherits:
Object show all
Defined in:
lib/dropbox/extensions/string.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#ends_with?(suffix) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


6
7
8
# File 'lib/dropbox/extensions/string.rb', line 6

def ends_with?(suffix) # :nodoc:
  self[-suffix.length, suffix.length] == suffix
end

#starts_with?(prefix) ⇒ Boolean

:nodoc:

Returns:

  • (Boolean)


2
3
4
# File 'lib/dropbox/extensions/string.rb', line 2

def starts_with?(prefix) # :nodoc:
  self[0, prefix.length] == prefix
end