Method: Game#fetch_definition

Defined in:
lib/game.rb

#fetch_definition(word) ⇒ Object



53
54
55
56
# File 'lib/game.rb', line 53

def fetch_definition word
  definitions = `dict "#{word}" 2>/dev/null | grep '     ' | head -2`.chomp.gsub("     ","").split(/[\r\n]/)
  definitions.uniq.join(" -- ")
end