Class: TheFreeDictionary::Dictionary

Inherits:
Object
  • Object
show all
Defined in:
lib/the_free_dictionary/dictionary.rb

Direct Known Subclasses

Chinese, English, French, German, Italian, Russian, Spanish

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#languageObject

Returns the value of attribute language.



7
8
9
# File 'lib/the_free_dictionary/dictionary.rb', line 7

def language
  @language
end

#regionObject

Returns the value of attribute region.



7
8
9
# File 'lib/the_free_dictionary/dictionary.rb', line 7

def region
  @region
end

Instance Method Details

#find(statement) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/the_free_dictionary/dictionary.rb', line 9

def find(statement)
  uri = build_uri(statement)
  response = fetch(uri)
  sound = build_sound_url(response)
  transcription = fetch_transcription(response)

  { sound:, transcription: }
end