Class: Mongo::Address::Unix
- Inherits:
-
Object
- Object
- Mongo::Address::Unix
- Defined in:
- lib/mongo/address/unix.rb
Overview
Sets up socket addresses.
Constant Summary collapse
- MATCH =
The regular expression to use to match a socket path.
Regexp.new('\.sock').freeze
Instance Attribute Summary collapse
-
#host ⇒ String
readonly
Host The host.
-
#port ⇒ nil
readonly
Port Will always be nil.
Class Method Summary collapse
-
.parse(address) ⇒ Array<String>
Parse a socket path.
Instance Method Summary collapse
-
#initialize(host, port = nil, host_name = nil) ⇒ Unix
constructor
Initialize the socket resolver.
-
#socket(timeout, ssl_options = {}) ⇒ Pool::Socket::Unix
Get a socket for the provided address type, given the options.
Constructor Details
#initialize(host, port = nil, host_name = nil) ⇒ Unix
Initialize the socket resolver.
56 57 58 |
# File 'lib/mongo/address/unix.rb', line 56 def initialize(host, port=nil, host_name=nil) @host = host end |
Instance Attribute Details
#host ⇒ String (readonly)
Returns host The host.
24 25 26 |
# File 'lib/mongo/address/unix.rb', line 24 def host @host end |
#port ⇒ nil (readonly)
Returns port Will always be nil.
27 28 29 |
# File 'lib/mongo/address/unix.rb', line 27 def port @port end |
Class Method Details
.parse(address) ⇒ Array<String>
Parse a socket path.
44 45 46 |
# File 'lib/mongo/address/unix.rb', line 44 def self.parse(address) [ address ] end |