Class: Howdy::Dictionary::UrbanDictionaryCom

Inherits:
Base
  • Object
show all
Defined in:
lib/howdy/dictionaries/urban_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



9
10
11
12
13
14
# File 'lib/howdy/dictionaries/urban_dictionary_com.rb', line 9

def parse
	document.css('table#entries tr td.text').each do |cell|
		result << "#{cell.search('div.definition').children.collect { |e| e.content }.join}\n"
		result << "#{cell.search('div.example').children.collect { |e| e.content }.join}\n\n"
	end
end