Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/cross-stub/fixes.rb

Instance Method Summary collapse

Instance Method Details

#end_with?(s) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/cross-stub/fixes.rb', line 4

def end_with?(s)
  ((idx = self.length - s.length) < 0) ? false : (self[idx .. -1] == s)
end