Module: Ethon::Easy::Operations
- Included in:
- Ethon::Easy
- Defined in:
- lib/ethon/easy/operations.rb
Overview
This module contains the logic to prepare and perform an easy.
Defined Under Namespace
Classes: PointerHelper
Instance Method Summary collapse
-
#cleanup ⇒ Object
Clean up the easy.
-
#handle ⇒ FFI::Pointer
Returns a pointer to the curl easy handle.
-
#handle=(h) ⇒ Object
Sets a pointer to the curl easy handle.
-
#perform ⇒ Integer
Perform the easy request.
-
#prepare ⇒ Object
deprecated
Deprecated.
It is no longer necessary to call prepare.
Instance Method Details
#cleanup ⇒ Object
Clean up the easy.
58 59 60 |
# File 'lib/ethon/easy/operations.rb', line 58 def cleanup handle.free end |
#handle ⇒ FFI::Pointer
Returns a pointer to the curl easy handle.
27 28 29 |
# File 'lib/ethon/easy/operations.rb', line 27 def handle @handle ||= FFI::AutoPointer.new(Curl.easy_init, PointerHelper.method(:release) ) end |
#handle=(h) ⇒ Object
Sets a pointer to the curl easy handle.
33 34 35 |
# File 'lib/ethon/easy/operations.rb', line 33 def handle=(h) @handle = h end |
#perform ⇒ Integer
Perform the easy request.
43 44 45 46 47 48 49 50 |
# File 'lib/ethon/easy/operations.rb', line 43 def perform @return_code = Curl.easy_perform(handle) if Ethon.logger.debug? Ethon.logger.debug { "ETHON: performed #{log_inspect}" } end complete @return_code end |
#prepare ⇒ Object
Deprecated.
It is no longer necessary to call prepare.
Prepare the easy. Options, headers and callbacks were set.
69 70 71 72 73 74 75 |
# File 'lib/ethon/easy/operations.rb', line 69 def prepare Ethon.logger.warn( "ETHON: It is no longer necessary to call "+ "Easy#prepare. It's going to be removed "+ "in future versions." ) end |