Class: LibZMQ::PollItem
- Inherits:
-
FFI::Struct
- Object
- FFI::Struct
- LibZMQ::PollItem
- Includes:
- PollItemLayout
- Defined in:
- lib/ffi-rzmq-core/structures.rb
Overview
PollItem class includes the PollItemLayout module so that we can use the basic FFI accessors to get at the structure’s fields. We also want to provide some higher-level Ruby accessors for convenience.
Instance Method Summary collapse
Methods included from PollItemLayout
Instance Method Details
#fd ⇒ Object
83 84 85 |
# File 'lib/ffi-rzmq-core/structures.rb', line 83 def fd self[:fd] end |
#inspect ⇒ Object
95 96 97 |
# File 'lib/ffi-rzmq-core/structures.rb', line 95 def inspect "socket [#{socket}], fd [#{fd}], events [#{self[:events]}], revents [#{self[:revents]}]" end |
#readable? ⇒ Boolean
87 88 89 |
# File 'lib/ffi-rzmq-core/structures.rb', line 87 def readable? (self[:revents] & ZMQ::POLLIN) > 0 end |
#socket ⇒ Object
79 80 81 |
# File 'lib/ffi-rzmq-core/structures.rb', line 79 def socket self[:socket] end |