Class: Mongo::Address::Unix
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/mongo/address/unix.rb |
Overview
Sets up socket addresses.
Constant Summary
-
MATCH =
The regular expression to use to match a socket path.
Regexp.new('\.sock').freeze
Class Method Summary
-
.new(host, port = nil, host_name = nil) ⇒ Unix
constructor
Initialize the socket resolver.
-
.parse(address) ⇒ Array<String>
Parse a socket path.
Instance Attribute Summary
- #host ⇒ String readonly
- #port ⇒ nil readonly
Instance Method Summary
-
#socket(socket_timeout, options = {}) ⇒ Mongo::Socket::Unix
Internal use only
Internal use only
Get a socket for the provided address type, given the options.
Constructor Details
.new(host, port = nil, host_name = nil) ⇒ Unix
Initialize the socket resolver.
Class Method Details
.parse(address) ⇒ Array
<String
>
Parse a socket path.
# File 'lib/mongo/address/unix.rb', line 47
def self.parse(address) [ address ] end
Instance Attribute Details
#host ⇒ String
(readonly)
# File 'lib/mongo/address/unix.rb', line 27
attr_reader :host
#port ⇒ nil
(readonly)
# File 'lib/mongo/address/unix.rb', line 30
attr_reader :port
Instance Method Details
#socket(socket_timeout, options = {}) ⇒ Mongo::Socket::Unix
This method is for internal use only.
Get a socket for the provided address type, given the options.