Class: LibZMQ::PollItem

Inherits:
FFI::Struct
  • Object
show all
Includes:
PollItemLayout
Defined in:
lib/ffi-rzmq/libzmq.rb

Overview

module PollItemLayout

Instance Method Summary collapse

Methods included from PollItemLayout

included

Instance Method Details

#both_accessible?Boolean

Returns:

  • (Boolean)


128
129
130
# File 'lib/ffi-rzmq/libzmq.rb', line 128

def both_accessible?
  readable? && writable?
end

#inspectObject



132
133
134
# File 'lib/ffi-rzmq/libzmq.rb', line 132

def inspect
  "socket [#{socket}], fd [#{self[:fd]}], events [#{self[:events]}], revents [#{self[:revents]}]"
end

#readable?Boolean

Returns:

  • (Boolean)


120
121
122
# File 'lib/ffi-rzmq/libzmq.rb', line 120

def readable?
  (self[:revents] & ZMQ::POLLIN) > 0
end

#socketObject



118
# File 'lib/ffi-rzmq/libzmq.rb', line 118

def socket() self[:socket]; end

#to_sObject



136
# File 'lib/ffi-rzmq/libzmq.rb', line 136

def to_s; inspect; end

#writable?Boolean

Returns:

  • (Boolean)


124
125
126
# File 'lib/ffi-rzmq/libzmq.rb', line 124

def writable?
  (self[:revents] & ZMQ::POLLOUT) > 0
end