Class: Howdy::Dictionary::DictionaryCom

Inherits:
Base
  • Object
show all
Defined in:
lib/howdy/dictionaries/dictionary_com.rb

Instance Attribute Summary

Attributes inherited from Base

#user_query

Instance Method Summary collapse

Methods inherited from Base

description, dict_description, dict_label, dict_url, doc_encoding, #document, encoding, inherited, #initialize, label, #print, #result, url

Constructor Details

This class inherits a constructor from Howdy::Dictionary::Base

Instance Method Details

#parseObject



11
12
13
14
15
16
17
# File 'lib/howdy/dictionaries/dictionary_com.rb', line 11

def parse
  document.css('div.KonaBody div.results_content div.luna-Ent div.body div.luna-Ent').each do |row|
    index = row.search('span.dnindex').children.collect { |e| e.content }.join
    data  = row.search('div.dndata').children.collect { |e| e.content }.join
    result << index + data
  end
end