Class: Bundler::SocketAddress
- Inherits:
-
Object
- Object
- Bundler::SocketAddress
- Defined in:
- lib/bundler/mirror.rb
Overview
Socket address builder.
Given a socket type, a host and a port,
provides a method to build sockaddr string
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(type, host, port) ⇒ SocketAddress
constructor
A new instance of SocketAddress.
- #to_socket_address ⇒ Object
Constructor Details
permalink #initialize(type, host, port) ⇒ SocketAddress
Returns a new instance of SocketAddress.
211 212 213 214 215 |
# File 'lib/bundler/mirror.rb', line 211 def initialize(type, host, port) @type = type @host = host @port = port end |
Instance Attribute Details
permalink #host ⇒ Object (readonly)
Returns the value of attribute host.
209 210 211 |
# File 'lib/bundler/mirror.rb', line 209 def host @host end |
permalink #port ⇒ Object (readonly)
Returns the value of attribute port.
209 210 211 |
# File 'lib/bundler/mirror.rb', line 209 def port @port end |
permalink #type ⇒ Object (readonly)
Returns the value of attribute type.
209 210 211 |
# File 'lib/bundler/mirror.rb', line 209 def type @type end |
Instance Method Details
permalink #to_socket_address ⇒ Object
[View source]
217 218 219 |
# File 'lib/bundler/mirror.rb', line 217 def to_socket_address Socket.pack_sockaddr_in(@port, @host) end |