Class: URL

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

Constant Summary collapse

ATTRIBUTES =
[
  :using,
  :tag, :branch, :revisions, :revision,
  :trust_cert, :cookies, :referer, :user_agent,
  :data
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, **options) ⇒ URL

Returns a new instance of URL



17
18
19
20
21
22
23
24
25
26
27
28
# File 'brew/Library/Homebrew/cask/url.rb', line 17

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

Instance Attribute Details

#specsObject (readonly)

Returns the value of attribute specs



11
12
13
# File 'brew/Library/Homebrew/cask/url.rb', line 11

def specs
  @specs
end

#uriObject (readonly)

Returns the value of attribute uri



11
12
13
# File 'brew/Library/Homebrew/cask/url.rb', line 11

def uri
  @uri
end