Class: PageGlimpse::ImageParser
- Inherits:
-
Object
- Object
- PageGlimpse::ImageParser
- Defined in:
- lib/page_glimpse/image_parser.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(options = {}, &block) ⇒ ImageParser
constructor
A new instance of ImageParser.
- #parse(response) ⇒ Object
Constructor Details
#initialize(options = {}, &block) ⇒ ImageParser
Returns a new instance of ImageParser.
7 8 |
# File 'lib/page_glimpse/image_parser.rb', line 7 def initialize( = {}, &block) end |
Instance Method Details
#parse(response) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/page_glimpse/image_parser.rb', line 10 def parse(response) image = Image.new image.content_type = response.headers[:content_type] image.filename = parse_filename(response.headers[:content_disposition]) image.content_length = (response.headers[:content_length] || 0).to_i image.content = response.to_s image end |