Class: Vkontakte::Proxy
- Inherits:
-
Object
- Object
- Vkontakte::Proxy
- Defined in:
- lib/vkontakte/proxy.rb
Overview
:nodoc:
Constant Summary collapse
- VALID_PROXY_TYPES =
%i[http socks].freeze
Instance Attribute Summary collapse
-
#addr ⇒ Object
readonly
Returns the value of attribute addr.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, addr, port) ⇒ Proxy
constructor
A new instance of Proxy.
Constructor Details
#initialize(type, addr, port) ⇒ Proxy
Returns a new instance of Proxy.
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
#addr ⇒ Object (readonly)
Returns the value of attribute addr.
5 6 7 |
# File 'lib/vkontakte/proxy.rb', line 5 def addr @addr end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
5 6 7 |
# File 'lib/vkontakte/proxy.rb', line 5 def port @port end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/vkontakte/proxy.rb', line 5 def type @type end |