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.
160 161 162 163 164 165 166 |
# File 'lib/riser/sockaddr.rb', line 160 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.
171 172 173 |
# File 'lib/riser/sockaddr.rb', line 171 def group @group end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
169 170 171 |
# File 'lib/riser/sockaddr.rb', line 169 def mode @mode end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
170 171 172 |
# File 'lib/riser/sockaddr.rb', line 170 def owner @owner end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
168 169 170 |
# File 'lib/riser/sockaddr.rb', line 168 def path @path end |
Instance Method Details
#open_server ⇒ Object
189 190 191 |
# File 'lib/riser/sockaddr.rb', line 189 def open_server UNIXServer.new(@path) end |
#to_address ⇒ Object
173 174 175 |
# File 'lib/riser/sockaddr.rb', line 173 def to_address super << @path end |
#to_option ⇒ Object
177 178 179 180 181 182 183 |
# File 'lib/riser/sockaddr.rb', line 177 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
185 186 187 |
# File 'lib/riser/sockaddr.rb', line 185 def to_s "unix:#{@path}" end |