123456789_123456789_123456789_123456789_123456789_

Class: Bundler::SocketAddress

Relationships & Source Files
Inherits: Object
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

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(type, host, port) ⇒ SocketAddress

[ GitHub ]

  
# File 'lib/bundler/mirror.rb', line 213

def initialize(type, host, port)
  @type = type
  @host = host
  @port = port
end

Instance Attribute Details

#host (readonly)

[ GitHub ]

  
# File 'lib/bundler/mirror.rb', line 211

attr_reader :type, :host, :port

#port (readonly)

[ GitHub ]

  
# File 'lib/bundler/mirror.rb', line 211

attr_reader :type, :host, :port

#type (readonly)

[ GitHub ]

  
# File 'lib/bundler/mirror.rb', line 211

attr_reader :type, :host, :port

Instance Method Details

#to_socket_address

[ GitHub ]

  
# File 'lib/bundler/mirror.rb', line 219

def to_socket_address
  Socket.pack_sockaddr_in(@port, @host)
end