class MWDictionaryGem::Dictionary

Public Class Methods

new(dict_api_key, thes_api_key = nil) click to toggle source
Calls superclass method
# File lib/mw-dictionary.rb, line 10
def initialize(dict_api_key, thes_api_key = nil)
  @cache = Cache.new
  @client = Client.new(dict_api_key, thes_api_key)
  @url = "https://www.dictionaryapi.com/api/v3/references"
  super()
end

Public Instance Methods

display(json) click to toggle source
# File lib/mw-dictionary.rb, line 39
def display(json)
  @cache.add(@word, @thesaurus, @thesaurus ? parse_thesaurus(json) : parse_dict(json))
end