Class: ImageInfo::RequestHandler
- Inherits:
-
Object
- Object
- ImageInfo::RequestHandler
- Defined in:
- lib/image_info/request_handler.rb
Instance Attribute Summary collapse
-
#image ⇒ Object
readonly
Returns the value of attribute image.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(image) ⇒ RequestHandler
constructor
A new instance of RequestHandler.
Constructor Details
#initialize(image) ⇒ RequestHandler
Returns a new instance of RequestHandler.
6 7 8 |
# File 'lib/image_info/request_handler.rb', line 6 def initialize(image) @image = image end |
Instance Attribute Details
#image ⇒ Object (readonly)
Returns the value of attribute image.
4 5 6 |
# File 'lib/image_info/request_handler.rb', line 4 def image @image end |
Instance Method Details
#build ⇒ Object
10 11 12 13 14 |
# File 'lib/image_info/request_handler.rb', line 10 def build ::Typhoeus::Request.new(image.uri.to_s, followlocation: true, accept_encoding: :gzip).tap do |request| request.on_complete { |response| on_complete(response) } end end |