Class: String

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

Instance Method Summary collapse

Instance Method Details

#starts_with?(prefix) ⇒ Boolean

Returns:

  • (Boolean)


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

def starts_with?(prefix)                                                                                                                     
        prefix = prefix.to_s                                                                                                                       
        self[0, prefix.length] == prefix                                                                                                     
end