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.
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.
44 45 46 |
# File 'lib/ethon/easy/operations.rb', line 44 def cleanup handle.free end |
#handle ⇒ FFI::Pointer
Returns a pointer to the curl easy handle.
13 14 15 |
# File 'lib/ethon/easy/operations.rb', line 13 def handle @handle ||= FFI::AutoPointer.new(Curl.easy_init, Curl.method(:easy_cleanup)) end |
#handle=(h) ⇒ Object
Sets a pointer to the curl easy handle.
19 20 21 |
# File 'lib/ethon/easy/operations.rb', line 19 def handle=(h) @handle = h end |
#perform ⇒ Integer
Perform the easy request.
29 30 31 32 33 34 35 36 |
# File 'lib/ethon/easy/operations.rb', line 29 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.
55 56 57 58 59 60 61 |
# File 'lib/ethon/easy/operations.rb', line 55 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 |