module Ethon::Easy::Operations

This module contains the logic to prepare and perform an easy.

Public Instance Methods

handle() click to toggle source

Returns a pointer to the curl easy handle.

@example Return the handle.

easy.handle

@return [ FFI::Pointer ] A pointer to the curl easy handle.

# File lib/ethon/easy/operations.rb, line 13
def handle
  @handle ||= Curl.easy_init
end
perform() click to toggle source

Perform the easy request.

@example Perform the request.

easy.perform

@return [ Integer ] The return code.

# 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
prepare() click to toggle source

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

@example Prepare easy.

easy.prepare

@deprecated It is no longer necessary to call prepare.

# 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