Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/openid/extras.rb

Instance Method Summary collapse

Instance Method Details

#ends_with?(other) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/openid/extras.rb', line 7

def ends_with?(other)
  tail = self[-1 * other.length, other.length]
  tail == other
end

#starts_with?(other) ⇒ Boolean

Returns:

  • (Boolean)


2
3
4
5
# File 'lib/openid/extras.rb', line 2

def starts_with?(other)
  head = self[0, other.length]
  head == other
end