Sha256: b724d52a653efc139389b890cc4e3f08f876aca16d8ddd3865fa83dff91ab3ae

Contents?: true

Size: 1.12 KB

Versions: 6

Compression:

Stored size: 1.12 KB

Contents

module Ethon
  class Easy
    # This module contains the logic to prepare and perform
    # an easy.
    module Operations

      # Returns a pointer to the curl easy handle.
      #
      # @example Return the handle.
      #   easy.handle
      #
      # @return [ FFI::Pointer ] A pointer to the curl easy handle.
      def handle
        @handle ||= Curl.easy_init
      end

      # Perform the easy request.
      #
      # @example Perform the request.
      #   easy.perform
      #
      # @return [ Integer ] The return code.
      def perform
        @return_code = Curl.easy_perform(handle)
        complete
        Ethon.logger.debug("ETHON: performed #{self.log_inspect}")
        @return_code
      end

      # Prepare the easy. Options, headers and callbacks
      # were set.
      #
      # @example Prepare easy.
      #   easy.prepare
      #
      # @deprecated It is no longer necessary to call prepare.
      def prepare
        Ethon.logger.warn(
          "ETHON: It is no longer necessay to call "+
          "Easy#prepare. Its going to be removed "+
          "in future versions."
        )
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ethon-0.5.10 lib/ethon/easy/operations.rb
ethon-0.5.9 lib/ethon/easy/operations.rb
ethon-0.5.8 lib/ethon/easy/operations.rb
ethon-0.5.7 lib/ethon/easy/operations.rb
ethon-0.5.6 lib/ethon/easy/operations.rb
ethon-0.5.4 lib/ethon/easy/operations.rb