Sha256: 26a2264bee421c06370a147c11fd3fc6895df0f7924fde164348f9c1fc20a523

Contents?: true

Size: 815 Bytes

Versions: 11

Compression:

Stored size: 815 Bytes

Contents

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
      
      Curl.easy_options.each do |opt,props|
        eval %Q<
          def #{opt}=(value)
            Curl.set_option(:#{opt}, value, handle)
            value
          end
        > unless method_defined? opt.to_s+"="
        if props[:type]==:callback then
          eval %Q<
            def #{opt}(&block)
              @procs ||= {}
              @procs[:#{opt}]=block
              Curl.set_option(:#{opt}, block, handle)
              nil
            end
          > unless method_defined? opt.to_s
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
dwolla_swagger-1.0.6 vendor/bundle/ruby/2.2.0/gems/ethon-0.8.0/lib/ethon/easy/options.rb
ethon-0.8.0 lib/ethon/easy/options.rb
ethon-0.7.4 lib/ethon/easy/options.rb
ethon-0.7.3 lib/ethon/easy/options.rb
ethon-0.7.2 lib/ethon/easy/options.rb
ethon-0.7.1 lib/ethon/easy/options.rb
ethon-0.7.0 lib/ethon/easy/options.rb
ethon-0.6.3 lib/ethon/easy/options.rb
ethon-0.6.2 lib/ethon/easy/options.rb
ethon-0.6.1 lib/ethon/easy/options.rb
ethon-0.6.0 lib/ethon/easy/options.rb