Method: Curl::Easy.http_get

Defined in:
lib/curl/easy.rb

.http_get(*args) {|c| ... } ⇒ Object

call-seq:

Curl::Easy.http_get(url) { |easy| ... }          => #<Curl::Easy...>

Convenience method that creates a new Curl::Easy instance with the specified URL and calls http_get, before returning the new instance.

If a block is supplied, the new instance will be yielded just prior to the http_get call.

Yields:

  • (c)


401
402
403
404
405
406
# File 'lib/curl/easy.rb', line 401

def http_get(*args)
  c = Curl::Easy.new(*args)
  yield c if block_given?
  c.http_get
  c
end