Class: XS::LibXS::PollItem
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- XS::LibXS::PollItem
- Includes:
- PollItemLayout
- Defined in:
- lib/ffi-rxs/libxs.rb
Overview
module PollItemLayout
Instance Method Summary collapse
- #both_accessible? ⇒ Boolean
- #fd ⇒ Object
- #inspect ⇒ Object
- #readable? ⇒ Boolean
- #socket ⇒ Object
- #to_s ⇒ Object
- #writable? ⇒ Boolean
Instance Method Details
#both_accessible? ⇒ Boolean
147 148 149 |
# File 'lib/ffi-rxs/libxs.rb', line 147 def both_accessible? readable? && writable? end |
#fd ⇒ Object
137 |
# File 'lib/ffi-rxs/libxs.rb', line 137 def fd() self[:fd]; end |
#inspect ⇒ Object
151 152 153 |
# File 'lib/ffi-rxs/libxs.rb', line 151 def inspect "socket [#{socket}], fd [#{fd}], events [#{self[:events]}], revents [#{self[:revents]}]" end |
#readable? ⇒ Boolean
139 140 141 |
# File 'lib/ffi-rxs/libxs.rb', line 139 def readable? (self[:revents] & XS::POLLIN) > 0 end |
#socket ⇒ Object
135 |
# File 'lib/ffi-rxs/libxs.rb', line 135 def socket() self[:socket]; end |
#to_s ⇒ Object
155 |
# File 'lib/ffi-rxs/libxs.rb', line 155 def to_s; inspect; end |