Skip to content

Instantly share code, notes, and snippets.

class Dictionary
def initialize
@dict = {}
end
def entries
@dict
end
def add(word)
# word_definition = {"word_definition" => nil} if word_definition.class == "String"
@dkan
dkan / dictionary
Created June 14, 2012 23:16
dictionary
class Dictionary
def initialize
@dict = {}
end
def entries
@dict
end
def add(word, definition = nil)
@dict[word] = definition