Module: PalindromeChecker
- Defined in:
- lib/palindrome_checker.rb,
lib/palindrome_checker/version.rb,
sig/palindrome_checker.rbs
Defined Under Namespace
Classes: Error
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
Class Method Details
.is_palindrome?(text) ⇒ Boolean
7 8 9 10 11 |
# File 'lib/palindrome_checker.rb', line 7 def self.is_palindrome?(text) # 小文字化し、非英数字を削除 cleaned_text = text.downcase.gsub(/[^a-z0-9]/, '') cleaned_text == cleaned_text.reverse end |