Skip to content

Instantly share code, notes, and snippets.

@stephaniehoh
Created October 7, 2013 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephaniehoh/6871313 to your computer and use it in GitHub Desktop.
Save stephaniehoh/6871313 to your computer and use it in GitHub Desktop.
class Anagram
attr_accessor :test_word
def initialize(test_word)
@test_word = test_word
end
def match(array)
array.select do |item|
item.each_char.sort == test_word.each_char.sort
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment