Sha256: d49dd4c72580c31ab11f376b97e00e6dae2525c847713d4d4f054c35ccb8216f

Contents?: true

Size: 1.07 KB

Versions: 6759

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true
module Ethon
  class Easy

    # This module contains the logic and knowledge about the
    # available options on easy.
    module Options
      attr_reader :url

      def url=(value)
        @url = value
        Curl.set_option(:url, value, handle)
      end

      def escape=( b )
        @escape = b
      end

      def escape?
        return true if !defined?(@escape) || @escape.nil?
        @escape
      end

      def multipart=(b)
        @multipart = b
      end

      def multipart?
        !!@multipart
      end

      Curl.easy_options(nil).each do |opt, props|
        method_name = "#{opt}=".freeze
        unless method_defined? method_name
          define_method(method_name) do |value|
            Curl.set_option(opt, value, handle)
            value
          end
        end
        next if props[:type] != :callback || method_defined?(opt)
        define_method(opt) do |&block|
          @procs ||= {}
          @procs[opt.to_sym] = block
          Curl.set_option(opt, block, handle)
          nil
        end
      end
    end
  end
end

Version data entries

6,759 entries across 6,757 versions & 23 rubygems

Version Path
ory-client-0.0.1.alpha74 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha73 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha72 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha71 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha70 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha69 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha68 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha67 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha66 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-oathkeeper-client-0.38.19.beta1 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-oathkeeper-client-0.38.18.beta1 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-oathkeeper-client-0.38.17.beta1 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
avalara_sdk-2.4.7 vendor/bundle/ruby/2.6.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha58 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha57 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha56 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha55 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha54 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha53 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb
ory-client-0.0.1.alpha52 vendor/bundle/ruby/2.5.0/gems/ethon-0.15.0/lib/ethon/easy/options.rb