class Spidr::Proxy

@since 0.6.0

Constants

DEFAULT_PORT

Default port to use.

Public Class Methods

new(attributes={}) click to toggle source

Initializes the proxy.

@param [Hash] attributes

Attributes for the proxy.

@option attributes [String] :host

The host the proxy is running on.

@option attributes [Integer] :port

The port the proxy is running on.

@option attributes [String] :user

The user to authenticate as with the proxy.

@option attributes [String] :password

The password to authenticate with.
Calls superclass method
# File lib/spidr/proxy.rb, line 28
def initialize(attributes={})
  super(
    attributes[:host],
    attributes.fetch(:port,DEFAULT_PORT),
    attributes[:user],
    attributes[:password]
  )
end

Public Instance Methods

disabled?() click to toggle source

Determines if the proxy is not set.

@return [Boolean]

# File lib/spidr/proxy.rb, line 51
def disabled?
  host.nil?
end
enabled?() click to toggle source

Determines if the proxy settings are set.

@return [Boolean]

# File lib/spidr/proxy.rb, line 42
def enabled?
  !host.nil?
end