Class: Drophunter::FileTypes::Image

Inherits:
Struct
  • Object
show all
Defined in:
lib/drophunter/file_types/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



3
4
5
# File 'lib/drophunter/file_types/image.rb', line 3

def content
  @content
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



3
4
5
# File 'lib/drophunter/file_types/image.rb', line 3

def id
  @id
end

Instance Method Details

#find_and_save(saver) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/drophunter/file_types/image.rb', line 4

def find_and_save(saver)
  if image_element
    puts "#{id} is OK"

    saver.save(id, image_element.attr("src"))
  else
    puts "#{id} is not a Droplr image"
  end
end