Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/eagleclaw/string.rb
Instance Method Summary collapse
Instance Method Details
#ends_with?(string) ⇒ Boolean
8 9 10 |
# File 'lib/eagleclaw/string.rb', line 8 def ends_with?(string) !! (self =~ Regexp.new(Regexp.escape(string) + '$')) end |
#sha1 ⇒ Object
12 13 14 |
# File 'lib/eagleclaw/string.rb', line 12 def sha1 (Digest::SHA1.new << self).hexdigest end |
#starts_with?(string) ⇒ Boolean
4 5 6 |
# File 'lib/eagleclaw/string.rb', line 4 def starts_with?(string) !! (self =~ Regexp.new('^' + Regexp.escape(string))) end |