Skip to content

Instantly share code, notes, and snippets.

@jamesjtong
Last active December 24, 2015 21:48
Show Gist options
  • Save jamesjtong/6867827 to your computer and use it in GitHub Desktop.
Save jamesjtong/6867827 to your computer and use it in GitHub Desktop.
class Anagram
attr_accessor :word
def initialize(word)
@word = word
end
def match(array)
array.select {|item| item.downcase.split("").sort == self.word.downcase.split("").sort}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment