Sha256: 5c42f105ea1da31b4cf5ea598ce520be6628159bbe1d0b0d27ad46c784673d9d

Contents?: true

Size: 611 Bytes

Versions: 9

Compression:

Stored size: 611 Bytes

Contents

require 'forwardable'
require 'uri'

class LimitedURI
  extend Forwardable

  def_delegators :@uri, :scheme,
                        :host,
                        :port,
                        :port=,
                        :path,
                        :query,
                        :query=,
                        :to_s

  def initialize(uri)
    @uri = uri
  end

  def ==(other)
    to_s == other.to_s
  end

  def self.parse(uri)
    return uri if uri.is_a? LimitedURI
    return new(uri) if uri.is_a? URI
    return new(URI.parse(uri)) if uri.is_a? String

    raise URI::InvalidURIError
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
dwolla_swagger-1.0.6 vendor/bundle/ruby/2.2.0/gems/vcr-2.9.3/spec/support/limited_uri.rb
vcr-2.9.3 spec/support/limited_uri.rb
vcr-2.9.2 spec/support/limited_uri.rb
vcr-2.9.1 spec/support/limited_uri.rb
vcr-2.9.0 spec/support/limited_uri.rb
social_url_stats-0.0.1 vendor/ruby/1.9.1/gems/vcr-2.8.0/spec/support/limited_uri.rb
vcr-2.8.0 spec/support/limited_uri.rb
vcr-2.7.0 spec/support/limited_uri.rb
vcr-2.6.0 spec/support/limited_uri.rb