Class: Lunar::FuzzyWord

Inherits:
String
  • Object
show all
Defined in:
lib/lunar/fuzzy_word.rb

Overview

Examples:


expected = %w(a ab abr abra abrah abraha abraham)
FuzzyWord.new("Abraham").partials == expected
# => true

Instance Method Summary collapse

Instance Method Details

#partialsObject



11
12
13
# File 'lib/lunar/fuzzy_word.rb', line 11

def partials
  (1..length).map { |i| self[0, i].downcase }
end