Module: Stringutils

Defined in:
lib/stringutils.rb,
lib/stringutils/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.palindrome?(str) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/stringutils.rb', line 8

def self.palindrome?(str)
  str == reverse(str)? (true) : (false)
end

.reverse(str) ⇒ Object



4
5
6
# File 'lib/stringutils.rb', line 4

def self.reverse(str)
  str.reverse
end