Module: OpenString
- Included in:
- String
- Defined in:
- lib/open_string.rb
Overview
Public: Provides extension methods for the built-in String class.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#palindrome? ⇒ Boolean
Public: Determines if self has the same sequence of characters as evaluated from index 0 to self.length and from self.length to 0.
Instance Method Details
#palindrome? ⇒ Boolean
Public: Determines if self has the same sequence of characters as evaluated from index 0 to self.length and from self.length to 0
Returns true iff self contains the same sequence of characters forwards as it does backwards.
10 11 12 |
# File 'lib/open_string.rb', line 10 def palindrome? self == reverse end |