Class: Dict::Glosbe

Inherits:
Dictionary show all
Defined in:
lib/dict/glosbe.rb

Instance Method Summary collapse

Methods inherited from Dictionary

#check_arguments, #initialize, message, #uri

Constructor Details

This class inherits a constructor from Dict::Dictionary

Instance Method Details

#translateObject

returns an Dict::Result object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/dict/glosbe.rb', line 12

def translate
    if is_polish?(doc = get_content(GLOSBE_PL, @word))
      add_translations(get_translations(doc))
      add_examples(get_examples(doc, 'en'))
    else
      doc = get_content(GLOSBE_EN, @word) 
      add_translations(get_translations(doc))
      add_examples(get_examples(doc, 'pl'))
    end

    @result
end