Sha256: caf93356d98372e9934a91386c8b45635cd20404e9aa4756da8b139776b0249d

Contents?: true

Size: 653 Bytes

Versions: 1

Compression:

Stored size: 653 Bytes

Contents

module Typhoeus
  module Responses # :nodoc:

    # This module contains logic for providing the
    # old accessors.
    module Legacy

      # The legacy mapping.
      MAPPING = {
        :body => :response_body,
        :code => :response_code,
        :curl_return_code => :return_code,
        :time => :total_time,
        :app_connect_time => :appconnect_time,
        :start_transfer_time => :starttransfer_time,
        :name_lookup_time => :namelookup_time,
        :headers_hash => :header
      }

      MAPPING.each do |old, new|
        define_method(old) do
          options[new] || options[old]
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
typhoeus-0.5.0.alpha lib/typhoeus/responses/legacy.rb