Sha256: 830e3de1a7d2bc12951fab3fec65f6e884077b79c4a1dc4193dccaaa5827353b
Contents?: true
Size: 583 Bytes
Versions: 20
Compression:
Stored size: 583 Bytes
Contents
# frozen_string_literal: true require 'addressable/uri' require 'proxy_rb/credentials' # ProxyRb module ProxyRb # A resource class Resource attr_accessor :content attr_reader :credentials, :url def initialize(url) @url = Addressable::URI.parse(url) end # Return credentials from url # # @return [Credentials] # The credentials from url def credentials Credentials.new(url.user, url.password) end # Convert resource to url # # @return [String] url # The url def to_s url.to_s end end end
Version data entries
20 entries across 20 versions & 1 rubygems