Class: Spidr::Proxy

Inherits:
Struct
  • Object
show all
Defined in:
lib/spidr/proxy.rb

Overview

Since:

  • 0.6.0

Constant Summary collapse

DEFAULT_PORT =

Default port to use.

Since:

  • 0.6.0

8080

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host: nil, port: DEFAULT_PORT, user: nil, password: nil) ⇒ Proxy

Initializes the proxy.

Since:

  • 0.6.0



27
28
29
# File 'lib/spidr/proxy.rb', line 27

def initialize(host: nil, port: DEFAULT_PORT, user: nil, password: nil)
  super(host,port,user,password)
end

Instance Attribute Details

#hostObject

Returns the value of attribute host



7
8
9
# File 'lib/spidr/proxy.rb', line 7

def host
  @host
end

#passwordObject

Returns the value of attribute password



7
8
9
# File 'lib/spidr/proxy.rb', line 7

def password
  @password
end

#portObject

Returns the value of attribute port



7
8
9
# File 'lib/spidr/proxy.rb', line 7

def port
  @port
end

#userObject

Returns the value of attribute user



7
8
9
# File 'lib/spidr/proxy.rb', line 7

def user
  @user
end

Instance Method Details

#disabled?Boolean

Determines if the proxy is not set.

Since:

  • 0.6.0



45
46
47
# File 'lib/spidr/proxy.rb', line 45

def disabled?
  host.nil?
end

#enabled?Boolean

Determines if the proxy settings are set.

Since:

  • 0.6.0



36
37
38
# File 'lib/spidr/proxy.rb', line 36

def enabled?
  !host.nil?
end