Sha256: d9fa3ddd58f9fe0a69b4859f3b24b7e2da63a2be71fc03fbd84f0da079c92568

Contents?: true

Size: 626 Bytes

Versions: 9

Compression:

Stored size: 626 Bytes

Contents

class Proxy
  attr_accessor :ip, :port, :username, :password, :status, :last_used, :user_agent

  def initialize(ip:, port: 80, username: nil, password: nil, status: nil, last_used: nil, user_agent: nil)
    @ip, @port, @username, @password, @status, @last_used =
                  ip, port, username, password, status, last_used
  end

  def dead
    @status = 'dead'
    @last_used = Time.now
  end

  def good
    @status = 'good'
    @last_used = Time.now
  end

  def good?
    @status == 'good' ? true : false
  end

  def dead?
    @status == 'dead' ? true : false
  end

  def used
    @last_used = Time.now
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
linsc-0.0.11 lib/linsc/proxy.rb
linsc-0.0.10 lib/linsc/proxy.rb
linsc-0.0.9 lib/linsc/proxy.rb
linsc-0.0.8 lib/linsc/proxy.rb
linsc-0.0.7 lib/linsc/proxy.rb
linsc-0.0.6 lib/linsc/proxy.rb
linsc-0.0.5 lib/linsc/proxy.rb
linsc-0.0.3 lib/linsc/proxy.rb
linsc-0.0.2 lib/linsc/proxy.rb