class Descartes::Treccani

Public Instance Methods

citazione(m) click to toggle source
# File lib/descartes/modules/treccani.rb, line 27
def citazione(m)
  treccani = Treccani::Citazione.new.get
  m.reply "#{treccani[:citazione]} - #{treccani[:autore]}"
end
enciclopedia(m, word) click to toggle source
# File lib/descartes/modules/treccani.rb, line 32
def enciclopedia(m, word)
  begin
    m.reply Treccani::Enciclopedia.new.get(word)[:meanings].first[0..400]
    m.reply "- #{Treccani::Enciclopedia.new.get_url word}"
  rescue
    m.reply 'Vocabolo non trovato.'
  end
end
sinonimi(m, word) click to toggle source
# File lib/descartes/modules/treccani.rb, line 41
def sinonimi(m, word)
  begin
    m.reply Treccani::Sinonimi.new.get word
  rescue
    m.reply 'Vocabolo non trovato.'
  end
end
vocabolario(m, word) click to toggle source
# File lib/descartes/modules/treccani.rb, line 49
def vocabolario(m, word)
  begin
    m.reply Treccani::Vocabolario.new.get(word)[:meanings].first[0..400]
    m.reply "- #{Treccani::Vocabolario.new.get_url word}"
  rescue
    m.reply 'Vocabolo non trovato.'
  end
end