Class: Riser::UNIXSocketAddress
- Inherits:
-
SocketAddress
- Object
- SocketAddress
- Riser::UNIXSocketAddress
- Defined in:
- lib/riser/sockaddr.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from SocketAddress
Instance Method Summary collapse
-
#initialize(path, backlog = nil, mode = nil, owner = nil, group = nil) ⇒ UNIXSocketAddress
constructor
A new instance of UNIXSocketAddress.
- #open_server ⇒ Object
- #to_address ⇒ Object
- #to_option ⇒ Object
- #to_s ⇒ Object
Methods inherited from SocketAddress
Constructor Details
#initialize(path, backlog = nil, mode = nil, owner = nil, group = nil) ⇒ UNIXSocketAddress
Returns a new instance of UNIXSocketAddress.
127 128 129 130 131 132 133 |
# File 'lib/riser/sockaddr.rb', line 127 def initialize(path, backlog=nil, mode=nil, owner=nil, group=nil) super(:unix, backlog) @path = path @mode = mode @owner = owner @group = group end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
138 139 140 |
# File 'lib/riser/sockaddr.rb', line 138 def group @group end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
136 137 138 |
# File 'lib/riser/sockaddr.rb', line 136 def mode @mode end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
137 138 139 |
# File 'lib/riser/sockaddr.rb', line 137 def owner @owner end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
135 136 137 |
# File 'lib/riser/sockaddr.rb', line 135 def path @path end |
Instance Method Details
#open_server ⇒ Object
156 157 158 |
# File 'lib/riser/sockaddr.rb', line 156 def open_server UNIXServer.new(@path) end |
#to_address ⇒ Object
140 141 142 |
# File 'lib/riser/sockaddr.rb', line 140 def to_address super << @path end |
#to_option ⇒ Object
144 145 146 147 148 149 150 |
# File 'lib/riser/sockaddr.rb', line 144 def to_option option = super option[:mode] = @mode if @mode option[:owner] = @owner if @owner option[:group] = @group if @group option end |
#to_s ⇒ Object
152 153 154 |
# File 'lib/riser/sockaddr.rb', line 152 def to_s "unix:#{@path}" end |