Sha256: 2fcccd3a1b78096a7aae9cfde4a586a1b4550dc50db1137c9df4090de2dcf964

Contents?: true

Size: 613 Bytes

Versions: 18

Compression:

Stored size: 613 Bytes

Contents

require 'net/http'

module Resourceful
  class Resource
    def options(header = {})
      request(:options, nil, header)
    end

    def host_with_port
      add = Addressable::URI.parse(uri)
      !add.port.blank? && add.port != 80 ? [add.host, add.port].join(':') : add.host
    end

    alias_method_chain :host, :port
  end

  class NetHttpAdapter
    def net_http_request_class_with_options(method)
      if method == :options
        Net::HTTP::Options
      else
        net_http_request_class_without_options(method)
      end
    end

    alias_method_chain :net_http_request_class, :options
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
abiquo-etk-0.5.8 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.5.3 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.42 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.33 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.32 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.29 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.25 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.24 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.23 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.22 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.20 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.19 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.18 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.17 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.16 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.15 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.14 vendor/api_ruby_client/lib/core_ext.rb
abiquo-etk-0.4.13 vendor/api_ruby_client/lib/core_ext.rb