class IdiomList
Public Class Methods
all()
click to toggle source
# File lib/words_and_idioms/zz - idioms.rb, line 20 def self.all @@all end
new()
click to toggle source
# File lib/words_and_idioms/zz - idioms.rb, line 8 def initialize idiom_array = [] @@doc.css(" #openEntries .openEntry h3").each {|heading| idiom_array << heading.text} definition_array = [] @@doc.css(" #openEntries .openEntry .openDef").each {|definition| definition_array << definition.text} idiom_hash = Hash[idiom_array.zip definition_array] idiom_hash.each do |k,v| idiom = {"#{k}" => v} @@all << idiom end end