Class: URL Private

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
Library/Homebrew/cask/url.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class corresponding to the url stanza.

Instance Method Summary collapse

Constructor Details

#initialize(uri, **options) ⇒ URL

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of URL.


20
21
22
23
24
25
26
27
28
29
30
31
# File 'Library/Homebrew/cask/url.rb', line 20

def initialize(uri, **options)
  @uri        = URI(uri)
  @user_agent = :default

  ATTRIBUTES.each do |attribute|
    next unless options.key?(attribute)

    instance_variable_set("@#{attribute}", options[attribute])
  end

  @specs = options
end