Class: Drophunter::Page
- Inherits:
-
Struct
- Object
- Struct
- Drophunter::Page
- Defined in:
- lib/drophunter/page.rb
Constant Summary collapse
- BASE_URL =
"http://d.pr/i/"
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
Instance Method Summary collapse
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id
4 5 6 |
# File 'lib/drophunter/page.rb', line 4 def id @id end |
Instance Method Details
#save(something, saver) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/drophunter/page.rb', line 7 def save(something, saver) puts "Downloading #{url}" begin something.new(Nokogiri::HTML(open(url)), id).find_and_save(saver) rescue *.keys => error puts [error.class] end end |