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

Instance Method Details

#handleFFI::Pointer

Returns a pointer to the curl easy handle.

Examples:

Return the handle.

easy.handle

Returns:

  • (FFI::Pointer)

    A pointer to the curl easy handle.



13
14
15
# File 'lib/ethon/easy/operations.rb', line 13

def handle
  @handle ||= Curl.easy_init
end

#performInteger

Perform the easy request.

Examples:

Perform the request.

easy.perform

Returns:

  • (Integer)

    The return code.



23
24
25
26
27
28
# File 'lib/ethon/easy/operations.rb', line 23

def perform
  @return_code = Curl.easy_perform(handle)
  complete
  Ethon.logger.debug("ETHON: performed #{self.log_inspect}")
  @return_code
end

#prepareObject

Deprecated.

It is no longer necessary to call prepare.

Prepare the easy. Options, headers and callbacks were set.

Examples:

Prepare easy.

easy.prepare


37
38
39
40
41
42
43
# File 'lib/ethon/easy/operations.rb', line 37

def prepare
  Ethon.logger.warn(
    "ETHON: It is no longer necessay to call "+
    "Easy#prepare. Its going to be removed "+
    "in future versions."
  )
end