Class: Dalli::Socket::UNIX

Inherits:
UNIXSocket
  • Object
show all
Includes:
InstanceMethods
Defined in:
lib/dalli/socket.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods included from InstanceMethods

#read_available, #readfull, #safe_options

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



83
84
85
# File 'lib/dalli/socket.rb', line 83

def options
  @options
end

#serverObject

Returns the value of attribute server.



83
84
85
# File 'lib/dalli/socket.rb', line 83

def server
  @server
end

Class Method Details

.open(path, server, options = {}) ⇒ Object



85
86
87
88
89
90
91
92
# File 'lib/dalli/socket.rb', line 85

def self.open(path, server, options = {})
  Timeout.timeout(options[:socket_timeout]) do
    sock = new(path)
    sock.options = {path: path}.merge(options)
    sock.server = server
    sock
  end
end