Class: Vkontakte::Proxy

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

Overview

:nodoc:

Constant Summary collapse

VALID_PROXY_TYPES =
%i[http socks].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, addr, port) ⇒ Proxy

Returns a new instance of Proxy.

Raises:

  • (StandartError)


9
10
11
12
13
14
15
# File 'lib/vkontakte/proxy.rb', line 9

def initialize(type, addr, port)
  raise(StandartError, "#{`type`} is an invalid proxy type. Available values: #{VALID_PROXY_TYPES.join(',')}") unless VALID_PROXY_TYPES.include?(type)

  @type = type
  @addr = addr
  @port = port
end

Instance Attribute Details

#addrObject (readonly)

Returns the value of attribute addr.



5
6
7
# File 'lib/vkontakte/proxy.rb', line 5

def addr
  @addr
end

#portObject (readonly)

Returns the value of attribute port.



5
6
7
# File 'lib/vkontakte/proxy.rb', line 5

def port
  @port
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/vkontakte/proxy.rb', line 5

def type
  @type
end