czmq-ffi-gen 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -60,11 +60,18 @@ module CZMQ
60
60
  raise DestroyedError unless @ptr
61
61
  ptr_ptr = ::FFI::MemoryPointer.new :pointer
62
62
  ptr_ptr.write_pointer @ptr
63
- ObjectSpace.undefine_finalizer self if @finalizer
64
- @finalizer = nil
63
+ __undef_finalizer if @finalizer
65
64
  @ptr = nil
66
65
  ptr_ptr
67
66
  end
67
+ # Undefines the finalizer for this object.
68
+ # @note Only use this if you need to and can guarantee that the native
69
+ # object will be freed by other means.
70
+ # @return [void]
71
+ def __undef_finalizer
72
+ ObjectSpace.undefine_finalizer self
73
+ @finalizer = nil
74
+ end
68
75
 
69
76
  # Create new poller; the reader can be a libzmq socket (void *), a zsock_t
70
77
  # instance, or a zactor_t instance.
@@ -60,11 +60,18 @@ module CZMQ
60
60
  raise DestroyedError unless @ptr
61
61
  ptr_ptr = ::FFI::MemoryPointer.new :pointer
62
62
  ptr_ptr.write_pointer @ptr
63
- ObjectSpace.undefine_finalizer self if @finalizer
64
- @finalizer = nil
63
+ __undef_finalizer if @finalizer
65
64
  @ptr = nil
66
65
  ptr_ptr
67
66
  end
67
+ # Undefines the finalizer for this object.
68
+ # @note Only use this if you need to and can guarantee that the native
69
+ # object will be freed by other means.
70
+ # @return [void]
71
+ def __undef_finalizer
72
+ ObjectSpace.undefine_finalizer self
73
+ @finalizer = nil
74
+ end
68
75
 
69
76
  # Create a new socket. Returns the new socket, or NULL if the new socket
70
77
  # could not be created. Note that the symbol zsock_new (and other
@@ -81,130 +88,115 @@ module CZMQ
81
88
  end
82
89
 
83
90
  # Create a PUB socket. Default action is bind.
84
- # @param endpoint [String, #to_str, #to_s]
91
+ # @param endpoint [String, #to_s, nil]
85
92
  # @return [CZMQ::Zsock]
86
93
  def self.new_pub(endpoint)
87
- endpoint = String(endpoint)
88
94
  ptr = ::CZMQ::FFI.zsock_new_pub(endpoint)
89
95
  __new ptr
90
96
  end
91
97
 
92
98
  # Create a SUB socket, and optionally subscribe to some prefix string. Default
93
99
  # action is connect.
94
- # @param endpoint [String, #to_str, #to_s]
95
- # @param subscribe [String, #to_str, #to_s]
100
+ # @param endpoint [String, #to_s, nil]
101
+ # @param subscribe [String, #to_s, nil]
96
102
  # @return [CZMQ::Zsock]
97
103
  def self.new_sub(endpoint, subscribe)
98
- endpoint = String(endpoint)
99
- subscribe = String(subscribe)
100
104
  ptr = ::CZMQ::FFI.zsock_new_sub(endpoint, subscribe)
101
105
  __new ptr
102
106
  end
103
107
 
104
108
  # Create a REQ socket. Default action is connect.
105
- # @param endpoint [String, #to_str, #to_s]
109
+ # @param endpoint [String, #to_s, nil]
106
110
  # @return [CZMQ::Zsock]
107
111
  def self.new_req(endpoint)
108
- endpoint = String(endpoint)
109
112
  ptr = ::CZMQ::FFI.zsock_new_req(endpoint)
110
113
  __new ptr
111
114
  end
112
115
 
113
116
  # Create a REP socket. Default action is bind.
114
- # @param endpoint [String, #to_str, #to_s]
117
+ # @param endpoint [String, #to_s, nil]
115
118
  # @return [CZMQ::Zsock]
116
119
  def self.new_rep(endpoint)
117
- endpoint = String(endpoint)
118
120
  ptr = ::CZMQ::FFI.zsock_new_rep(endpoint)
119
121
  __new ptr
120
122
  end
121
123
 
122
124
  # Create a DEALER socket. Default action is connect.
123
- # @param endpoint [String, #to_str, #to_s]
125
+ # @param endpoint [String, #to_s, nil]
124
126
  # @return [CZMQ::Zsock]
125
127
  def self.new_dealer(endpoint)
126
- endpoint = String(endpoint)
127
128
  ptr = ::CZMQ::FFI.zsock_new_dealer(endpoint)
128
129
  __new ptr
129
130
  end
130
131
 
131
132
  # Create a ROUTER socket. Default action is bind.
132
- # @param endpoint [String, #to_str, #to_s]
133
+ # @param endpoint [String, #to_s, nil]
133
134
  # @return [CZMQ::Zsock]
134
135
  def self.new_router(endpoint)
135
- endpoint = String(endpoint)
136
136
  ptr = ::CZMQ::FFI.zsock_new_router(endpoint)
137
137
  __new ptr
138
138
  end
139
139
 
140
140
  # Create a PUSH socket. Default action is connect.
141
- # @param endpoint [String, #to_str, #to_s]
141
+ # @param endpoint [String, #to_s, nil]
142
142
  # @return [CZMQ::Zsock]
143
143
  def self.new_push(endpoint)
144
- endpoint = String(endpoint)
145
144
  ptr = ::CZMQ::FFI.zsock_new_push(endpoint)
146
145
  __new ptr
147
146
  end
148
147
 
149
148
  # Create a PULL socket. Default action is bind.
150
- # @param endpoint [String, #to_str, #to_s]
149
+ # @param endpoint [String, #to_s, nil]
151
150
  # @return [CZMQ::Zsock]
152
151
  def self.new_pull(endpoint)
153
- endpoint = String(endpoint)
154
152
  ptr = ::CZMQ::FFI.zsock_new_pull(endpoint)
155
153
  __new ptr
156
154
  end
157
155
 
158
156
  # Create an XPUB socket. Default action is bind.
159
- # @param endpoint [String, #to_str, #to_s]
157
+ # @param endpoint [String, #to_s, nil]
160
158
  # @return [CZMQ::Zsock]
161
159
  def self.new_xpub(endpoint)
162
- endpoint = String(endpoint)
163
160
  ptr = ::CZMQ::FFI.zsock_new_xpub(endpoint)
164
161
  __new ptr
165
162
  end
166
163
 
167
164
  # Create an XSUB socket. Default action is connect.
168
- # @param endpoint [String, #to_str, #to_s]
165
+ # @param endpoint [String, #to_s, nil]
169
166
  # @return [CZMQ::Zsock]
170
167
  def self.new_xsub(endpoint)
171
- endpoint = String(endpoint)
172
168
  ptr = ::CZMQ::FFI.zsock_new_xsub(endpoint)
173
169
  __new ptr
174
170
  end
175
171
 
176
172
  # Create a PAIR socket. Default action is connect.
177
- # @param endpoint [String, #to_str, #to_s]
173
+ # @param endpoint [String, #to_s, nil]
178
174
  # @return [CZMQ::Zsock]
179
175
  def self.new_pair(endpoint)
180
- endpoint = String(endpoint)
181
176
  ptr = ::CZMQ::FFI.zsock_new_pair(endpoint)
182
177
  __new ptr
183
178
  end
184
179
 
185
180
  # Create a STREAM socket. Default action is connect.
186
- # @param endpoint [String, #to_str, #to_s]
181
+ # @param endpoint [String, #to_s, nil]
187
182
  # @return [CZMQ::Zsock]
188
183
  def self.new_stream(endpoint)
189
- endpoint = String(endpoint)
190
184
  ptr = ::CZMQ::FFI.zsock_new_stream(endpoint)
191
185
  __new ptr
192
186
  end
193
187
 
194
188
  # Create a SERVER socket. Default action is bind.
195
- # @param endpoint [String, #to_str, #to_s]
189
+ # @param endpoint [String, #to_s, nil]
196
190
  # @return [CZMQ::Zsock]
197
191
  def self.new_server(endpoint)
198
- endpoint = String(endpoint)
199
192
  ptr = ::CZMQ::FFI.zsock_new_server(endpoint)
200
193
  __new ptr
201
194
  end
202
195
 
203
196
  # Create a CLIENT socket. Default action is connect.
204
- # @param endpoint [String, #to_str, #to_s]
197
+ # @param endpoint [String, #to_s, nil]
205
198
  # @return [CZMQ::Zsock]
206
199
  def self.new_client(endpoint)
207
- endpoint = String(endpoint)
208
200
  ptr = ::CZMQ::FFI.zsock_new_client(endpoint)
209
201
  __new ptr
210
202
  end
@@ -241,13 +233,12 @@ module CZMQ
241
233
  # clients being aware. Protocols that run on ephemeral ports should take
242
234
  # this into account.
243
235
  #
244
- # @param format [String, #to_str, #to_s]
236
+ # @param format [String, #to_s, nil]
245
237
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
246
238
  # @return [Integer]
247
239
  def bind(format, *args)
248
240
  raise DestroyedError unless @ptr
249
241
  self_p = @ptr
250
- format = String(format)
251
242
  result = ::CZMQ::FFI.zsock_bind(self_p, format, *args)
252
243
  result
253
244
  end
@@ -266,13 +257,12 @@ module CZMQ
266
257
  # Returns 0 if OK, -1 if the endpoint was invalid or the function
267
258
  # isn't supported.
268
259
  #
269
- # @param format [String, #to_str, #to_s]
260
+ # @param format [String, #to_s, nil]
270
261
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
271
262
  # @return [Integer]
272
263
  def unbind(format, *args)
273
264
  raise DestroyedError unless @ptr
274
265
  self_p = @ptr
275
- format = String(format)
276
266
  result = ::CZMQ::FFI.zsock_unbind(self_p, format, *args)
277
267
  result
278
268
  end
@@ -280,13 +270,12 @@ module CZMQ
280
270
  # Connect a socket to a formatted endpoint
281
271
  # Returns 0 if OK, -1 if the endpoint was invalid.
282
272
  #
283
- # @param format [String, #to_str, #to_s]
273
+ # @param format [String, #to_s, nil]
284
274
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
285
275
  # @return [Integer]
286
276
  def connect(format, *args)
287
277
  raise DestroyedError unless @ptr
288
278
  self_p = @ptr
289
- format = String(format)
290
279
  result = ::CZMQ::FFI.zsock_connect(self_p, format, *args)
291
280
  result
292
281
  end
@@ -295,13 +284,12 @@ module CZMQ
295
284
  # Returns 0 if OK, -1 if the endpoint was invalid or the function
296
285
  # isn't supported.
297
286
  #
298
- # @param format [String, #to_str, #to_s]
287
+ # @param format [String, #to_s, nil]
299
288
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
300
289
  # @return [Integer]
301
290
  def disconnect(format, *args)
302
291
  raise DestroyedError unless @ptr
303
292
  self_p = @ptr
304
- format = String(format)
305
293
  result = ::CZMQ::FFI.zsock_disconnect(self_p, format, *args)
306
294
  result
307
295
  end
@@ -313,13 +301,12 @@ module CZMQ
313
301
  # does not start with '@' or '>', the serverish argument defines whether
314
302
  # it is used to bind (serverish = true) or connect (serverish = false).
315
303
  #
316
- # @param endpoints [String, #to_str, #to_s]
304
+ # @param endpoints [String, #to_s, nil]
317
305
  # @param serverish [Boolean]
318
306
  # @return [Integer]
319
307
  def attach(endpoints, serverish)
320
308
  raise DestroyedError unless @ptr
321
309
  self_p = @ptr
322
- endpoints = String(endpoints)
323
310
  serverish = !(0==serverish||!serverish) # boolean
324
311
  result = ::CZMQ::FFI.zsock_attach(self_p, endpoints, serverish)
325
312
  result
@@ -362,13 +349,12 @@ module CZMQ
362
349
  # any arguments. Returns 0 if successful, -1 if sending failed for any
363
350
  # reason.
364
351
  #
365
- # @param picture [String, #to_str, #to_s]
352
+ # @param picture [String, #to_s, nil]
366
353
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
367
354
  # @return [Integer]
368
355
  def send(picture, *args)
369
356
  raise DestroyedError unless @ptr
370
357
  self_p = @ptr
371
- picture = String(picture)
372
358
  result = ::CZMQ::FFI.zsock_send(self_p, picture, *args)
373
359
  result
374
360
  end
@@ -404,12 +390,11 @@ module CZMQ
404
390
  #
405
391
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
406
392
  # object reference to use this method on
407
- # @param picture [String, #to_str, #to_s]
393
+ # @param picture [String, #to_s, nil]
408
394
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
409
395
  # @return [Integer]
410
396
  def self.send(self_p, picture, *args)
411
397
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
412
- picture = String(picture)
413
398
  result = ::CZMQ::FFI.zsock_send(self_p, picture, *args)
414
399
  result
415
400
  end
@@ -418,13 +403,12 @@ module CZMQ
418
403
  # version of zsock_send (), so please consult its documentation for the
419
404
  # details.
420
405
  #
421
- # @param picture [String, #to_str, #to_s]
406
+ # @param picture [String, #to_s, nil]
422
407
  # @param argptr [::FFI::Pointer, #to_ptr]
423
408
  # @return [Integer]
424
409
  def vsend(picture, argptr)
425
410
  raise DestroyedError unless @ptr
426
411
  self_p = @ptr
427
- picture = String(picture)
428
412
  result = ::CZMQ::FFI.zsock_vsend(self_p, picture, argptr)
429
413
  result
430
414
  end
@@ -437,12 +421,11 @@ module CZMQ
437
421
  #
438
422
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
439
423
  # object reference to use this method on
440
- # @param picture [String, #to_str, #to_s]
424
+ # @param picture [String, #to_s, nil]
441
425
  # @param argptr [::FFI::Pointer, #to_ptr]
442
426
  # @return [Integer]
443
427
  def self.vsend(self_p, picture, argptr)
444
428
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
445
- picture = String(picture)
446
429
  result = ::CZMQ::FFI.zsock_vsend(self_p, picture, argptr)
447
430
  result
448
431
  end
@@ -474,13 +457,12 @@ module CZMQ
474
457
  # An 'n' picture matches an empty frame; if the message does not match,
475
458
  # the method will return -1.
476
459
  #
477
- # @param picture [String, #to_str, #to_s]
460
+ # @param picture [String, #to_s, nil]
478
461
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
479
462
  # @return [Integer]
480
463
  def recv(picture, *args)
481
464
  raise DestroyedError unless @ptr
482
465
  self_p = @ptr
483
- picture = String(picture)
484
466
  result = ::CZMQ::FFI.zsock_recv(self_p, picture, *args)
485
467
  result
486
468
  end
@@ -516,12 +498,11 @@ module CZMQ
516
498
  #
517
499
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
518
500
  # object reference to use this method on
519
- # @param picture [String, #to_str, #to_s]
501
+ # @param picture [String, #to_s, nil]
520
502
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
521
503
  # @return [Integer]
522
504
  def self.recv(self_p, picture, *args)
523
505
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
524
- picture = String(picture)
525
506
  result = ::CZMQ::FFI.zsock_recv(self_p, picture, *args)
526
507
  result
527
508
  end
@@ -530,13 +511,12 @@ module CZMQ
530
511
  # va_list version of zsock_recv (), so please consult its documentation
531
512
  # for the details.
532
513
  #
533
- # @param picture [String, #to_str, #to_s]
514
+ # @param picture [String, #to_s, nil]
534
515
  # @param argptr [::FFI::Pointer, #to_ptr]
535
516
  # @return [Integer]
536
517
  def vrecv(picture, argptr)
537
518
  raise DestroyedError unless @ptr
538
519
  self_p = @ptr
539
- picture = String(picture)
540
520
  result = ::CZMQ::FFI.zsock_vrecv(self_p, picture, argptr)
541
521
  result
542
522
  end
@@ -549,12 +529,11 @@ module CZMQ
549
529
  #
550
530
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
551
531
  # object reference to use this method on
552
- # @param picture [String, #to_str, #to_s]
532
+ # @param picture [String, #to_s, nil]
553
533
  # @param argptr [::FFI::Pointer, #to_ptr]
554
534
  # @return [Integer]
555
535
  def self.vrecv(self_p, picture, argptr)
556
536
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
557
- picture = String(picture)
558
537
  result = ::CZMQ::FFI.zsock_vrecv(self_p, picture, argptr)
559
538
  result
560
539
  end
@@ -581,13 +560,12 @@ module CZMQ
581
560
  # Does not change or take ownership of any arguments. Returns 0 if
582
561
  # successful, -1 if sending failed for any reason.
583
562
  #
584
- # @param picture [String, #to_str, #to_s]
563
+ # @param picture [String, #to_s, nil]
585
564
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
586
565
  # @return [Integer]
587
566
  def bsend(picture, *args)
588
567
  raise DestroyedError unless @ptr
589
568
  self_p = @ptr
590
- picture = String(picture)
591
569
  result = ::CZMQ::FFI.zsock_bsend(self_p, picture, *args)
592
570
  result
593
571
  end
@@ -618,12 +596,11 @@ module CZMQ
618
596
  #
619
597
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
620
598
  # object reference to use this method on
621
- # @param picture [String, #to_str, #to_s]
599
+ # @param picture [String, #to_s, nil]
622
600
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
623
601
  # @return [Integer]
624
602
  def self.bsend(self_p, picture, *args)
625
603
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
626
- picture = String(picture)
627
604
  result = ::CZMQ::FFI.zsock_bsend(self_p, picture, *args)
628
605
  result
629
606
  end
@@ -640,13 +617,12 @@ module CZMQ
640
617
  # to be initialized. Returns 0 if successful, or -1 if it failed to read
641
618
  # a message.
642
619
  #
643
- # @param picture [String, #to_str, #to_s]
620
+ # @param picture [String, #to_s, nil]
644
621
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
645
622
  # @return [Integer]
646
623
  def brecv(picture, *args)
647
624
  raise DestroyedError unless @ptr
648
625
  self_p = @ptr
649
- picture = String(picture)
650
626
  result = ::CZMQ::FFI.zsock_brecv(self_p, picture, *args)
651
627
  result
652
628
  end
@@ -667,12 +643,11 @@ module CZMQ
667
643
  #
668
644
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
669
645
  # object reference to use this method on
670
- # @param picture [String, #to_str, #to_s]
646
+ # @param picture [String, #to_s, nil]
671
647
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
672
648
  # @return [Integer]
673
649
  def self.brecv(self_p, picture, *args)
674
650
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
675
- picture = String(picture)
676
651
  result = ::CZMQ::FFI.zsock_brecv(self_p, picture, *args)
677
652
  result
678
653
  end
@@ -1080,12 +1055,11 @@ module CZMQ
1080
1055
 
1081
1056
  # Set socket option `zap_domain`.
1082
1057
  #
1083
- # @param zap_domain [String, #to_str, #to_s]
1058
+ # @param zap_domain [String, #to_s, nil]
1084
1059
  # @return [void]
1085
1060
  def set_zap_domain(zap_domain)
1086
1061
  raise DestroyedError unless @ptr
1087
1062
  self_p = @ptr
1088
- zap_domain = String(zap_domain)
1089
1063
  result = ::CZMQ::FFI.zsock_set_zap_domain(self_p, zap_domain)
1090
1064
  result
1091
1065
  end
@@ -1096,11 +1070,10 @@ module CZMQ
1096
1070
  #
1097
1071
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1098
1072
  # object reference to use this method on
1099
- # @param zap_domain [String, #to_str, #to_s]
1073
+ # @param zap_domain [String, #to_s, nil]
1100
1074
  # @return [void]
1101
1075
  def self.set_zap_domain(self_p, zap_domain)
1102
1076
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1103
- zap_domain = String(zap_domain)
1104
1077
  result = ::CZMQ::FFI.zsock_set_zap_domain(self_p, zap_domain)
1105
1078
  result
1106
1079
  end
@@ -1205,12 +1178,11 @@ module CZMQ
1205
1178
 
1206
1179
  # Set socket option `plain_username`.
1207
1180
  #
1208
- # @param plain_username [String, #to_str, #to_s]
1181
+ # @param plain_username [String, #to_s, nil]
1209
1182
  # @return [void]
1210
1183
  def set_plain_username(plain_username)
1211
1184
  raise DestroyedError unless @ptr
1212
1185
  self_p = @ptr
1213
- plain_username = String(plain_username)
1214
1186
  result = ::CZMQ::FFI.zsock_set_plain_username(self_p, plain_username)
1215
1187
  result
1216
1188
  end
@@ -1221,11 +1193,10 @@ module CZMQ
1221
1193
  #
1222
1194
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1223
1195
  # object reference to use this method on
1224
- # @param plain_username [String, #to_str, #to_s]
1196
+ # @param plain_username [String, #to_s, nil]
1225
1197
  # @return [void]
1226
1198
  def self.set_plain_username(self_p, plain_username)
1227
1199
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1228
- plain_username = String(plain_username)
1229
1200
  result = ::CZMQ::FFI.zsock_set_plain_username(self_p, plain_username)
1230
1201
  result
1231
1202
  end
@@ -1257,12 +1228,11 @@ module CZMQ
1257
1228
 
1258
1229
  # Set socket option `plain_password`.
1259
1230
  #
1260
- # @param plain_password [String, #to_str, #to_s]
1231
+ # @param plain_password [String, #to_s, nil]
1261
1232
  # @return [void]
1262
1233
  def set_plain_password(plain_password)
1263
1234
  raise DestroyedError unless @ptr
1264
1235
  self_p = @ptr
1265
- plain_password = String(plain_password)
1266
1236
  result = ::CZMQ::FFI.zsock_set_plain_password(self_p, plain_password)
1267
1237
  result
1268
1238
  end
@@ -1273,11 +1243,10 @@ module CZMQ
1273
1243
  #
1274
1244
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1275
1245
  # object reference to use this method on
1276
- # @param plain_password [String, #to_str, #to_s]
1246
+ # @param plain_password [String, #to_s, nil]
1277
1247
  # @return [void]
1278
1248
  def self.set_plain_password(self_p, plain_password)
1279
1249
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1280
- plain_password = String(plain_password)
1281
1250
  result = ::CZMQ::FFI.zsock_set_plain_password(self_p, plain_password)
1282
1251
  result
1283
1252
  end
@@ -1359,12 +1328,11 @@ module CZMQ
1359
1328
 
1360
1329
  # Set socket option `curve_publickey`.
1361
1330
  #
1362
- # @param curve_publickey [String, #to_str, #to_s]
1331
+ # @param curve_publickey [String, #to_s, nil]
1363
1332
  # @return [void]
1364
1333
  def set_curve_publickey(curve_publickey)
1365
1334
  raise DestroyedError unless @ptr
1366
1335
  self_p = @ptr
1367
- curve_publickey = String(curve_publickey)
1368
1336
  result = ::CZMQ::FFI.zsock_set_curve_publickey(self_p, curve_publickey)
1369
1337
  result
1370
1338
  end
@@ -1375,11 +1343,10 @@ module CZMQ
1375
1343
  #
1376
1344
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1377
1345
  # object reference to use this method on
1378
- # @param curve_publickey [String, #to_str, #to_s]
1346
+ # @param curve_publickey [String, #to_s, nil]
1379
1347
  # @return [void]
1380
1348
  def self.set_curve_publickey(self_p, curve_publickey)
1381
1349
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1382
- curve_publickey = String(curve_publickey)
1383
1350
  result = ::CZMQ::FFI.zsock_set_curve_publickey(self_p, curve_publickey)
1384
1351
  result
1385
1352
  end
@@ -1436,12 +1403,11 @@ module CZMQ
1436
1403
 
1437
1404
  # Set socket option `curve_secretkey`.
1438
1405
  #
1439
- # @param curve_secretkey [String, #to_str, #to_s]
1406
+ # @param curve_secretkey [String, #to_s, nil]
1440
1407
  # @return [void]
1441
1408
  def set_curve_secretkey(curve_secretkey)
1442
1409
  raise DestroyedError unless @ptr
1443
1410
  self_p = @ptr
1444
- curve_secretkey = String(curve_secretkey)
1445
1411
  result = ::CZMQ::FFI.zsock_set_curve_secretkey(self_p, curve_secretkey)
1446
1412
  result
1447
1413
  end
@@ -1452,11 +1418,10 @@ module CZMQ
1452
1418
  #
1453
1419
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1454
1420
  # object reference to use this method on
1455
- # @param curve_secretkey [String, #to_str, #to_s]
1421
+ # @param curve_secretkey [String, #to_s, nil]
1456
1422
  # @return [void]
1457
1423
  def self.set_curve_secretkey(self_p, curve_secretkey)
1458
1424
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1459
- curve_secretkey = String(curve_secretkey)
1460
1425
  result = ::CZMQ::FFI.zsock_set_curve_secretkey(self_p, curve_secretkey)
1461
1426
  result
1462
1427
  end
@@ -1513,12 +1478,11 @@ module CZMQ
1513
1478
 
1514
1479
  # Set socket option `curve_serverkey`.
1515
1480
  #
1516
- # @param curve_serverkey [String, #to_str, #to_s]
1481
+ # @param curve_serverkey [String, #to_s, nil]
1517
1482
  # @return [void]
1518
1483
  def set_curve_serverkey(curve_serverkey)
1519
1484
  raise DestroyedError unless @ptr
1520
1485
  self_p = @ptr
1521
- curve_serverkey = String(curve_serverkey)
1522
1486
  result = ::CZMQ::FFI.zsock_set_curve_serverkey(self_p, curve_serverkey)
1523
1487
  result
1524
1488
  end
@@ -1529,11 +1493,10 @@ module CZMQ
1529
1493
  #
1530
1494
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1531
1495
  # object reference to use this method on
1532
- # @param curve_serverkey [String, #to_str, #to_s]
1496
+ # @param curve_serverkey [String, #to_s, nil]
1533
1497
  # @return [void]
1534
1498
  def self.set_curve_serverkey(self_p, curve_serverkey)
1535
1499
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1536
- curve_serverkey = String(curve_serverkey)
1537
1500
  result = ::CZMQ::FFI.zsock_set_curve_serverkey(self_p, curve_serverkey)
1538
1501
  result
1539
1502
  end
@@ -1690,12 +1653,11 @@ module CZMQ
1690
1653
 
1691
1654
  # Set socket option `gssapi_principal`.
1692
1655
  #
1693
- # @param gssapi_principal [String, #to_str, #to_s]
1656
+ # @param gssapi_principal [String, #to_s, nil]
1694
1657
  # @return [void]
1695
1658
  def set_gssapi_principal(gssapi_principal)
1696
1659
  raise DestroyedError unless @ptr
1697
1660
  self_p = @ptr
1698
- gssapi_principal = String(gssapi_principal)
1699
1661
  result = ::CZMQ::FFI.zsock_set_gssapi_principal(self_p, gssapi_principal)
1700
1662
  result
1701
1663
  end
@@ -1706,11 +1668,10 @@ module CZMQ
1706
1668
  #
1707
1669
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1708
1670
  # object reference to use this method on
1709
- # @param gssapi_principal [String, #to_str, #to_s]
1671
+ # @param gssapi_principal [String, #to_s, nil]
1710
1672
  # @return [void]
1711
1673
  def self.set_gssapi_principal(self_p, gssapi_principal)
1712
1674
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1713
- gssapi_principal = String(gssapi_principal)
1714
1675
  result = ::CZMQ::FFI.zsock_set_gssapi_principal(self_p, gssapi_principal)
1715
1676
  result
1716
1677
  end
@@ -1742,12 +1703,11 @@ module CZMQ
1742
1703
 
1743
1704
  # Set socket option `gssapi_service_principal`.
1744
1705
  #
1745
- # @param gssapi_service_principal [String, #to_str, #to_s]
1706
+ # @param gssapi_service_principal [String, #to_s, nil]
1746
1707
  # @return [void]
1747
1708
  def set_gssapi_service_principal(gssapi_service_principal)
1748
1709
  raise DestroyedError unless @ptr
1749
1710
  self_p = @ptr
1750
- gssapi_service_principal = String(gssapi_service_principal)
1751
1711
  result = ::CZMQ::FFI.zsock_set_gssapi_service_principal(self_p, gssapi_service_principal)
1752
1712
  result
1753
1713
  end
@@ -1758,11 +1718,10 @@ module CZMQ
1758
1718
  #
1759
1719
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
1760
1720
  # object reference to use this method on
1761
- # @param gssapi_service_principal [String, #to_str, #to_s]
1721
+ # @param gssapi_service_principal [String, #to_s, nil]
1762
1722
  # @return [void]
1763
1723
  def self.set_gssapi_service_principal(self_p, gssapi_service_principal)
1764
1724
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
1765
- gssapi_service_principal = String(gssapi_service_principal)
1766
1725
  result = ::CZMQ::FFI.zsock_set_gssapi_service_principal(self_p, gssapi_service_principal)
1767
1726
  result
1768
1727
  end
@@ -2146,12 +2105,11 @@ module CZMQ
2146
2105
 
2147
2106
  # Set socket option `subscribe`.
2148
2107
  #
2149
- # @param subscribe [String, #to_str, #to_s]
2108
+ # @param subscribe [String, #to_s, nil]
2150
2109
  # @return [void]
2151
2110
  def set_subscribe(subscribe)
2152
2111
  raise DestroyedError unless @ptr
2153
2112
  self_p = @ptr
2154
- subscribe = String(subscribe)
2155
2113
  result = ::CZMQ::FFI.zsock_set_subscribe(self_p, subscribe)
2156
2114
  result
2157
2115
  end
@@ -2162,23 +2120,21 @@ module CZMQ
2162
2120
  #
2163
2121
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
2164
2122
  # object reference to use this method on
2165
- # @param subscribe [String, #to_str, #to_s]
2123
+ # @param subscribe [String, #to_s, nil]
2166
2124
  # @return [void]
2167
2125
  def self.set_subscribe(self_p, subscribe)
2168
2126
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
2169
- subscribe = String(subscribe)
2170
2127
  result = ::CZMQ::FFI.zsock_set_subscribe(self_p, subscribe)
2171
2128
  result
2172
2129
  end
2173
2130
 
2174
2131
  # Set socket option `unsubscribe`.
2175
2132
  #
2176
- # @param unsubscribe [String, #to_str, #to_s]
2133
+ # @param unsubscribe [String, #to_s, nil]
2177
2134
  # @return [void]
2178
2135
  def set_unsubscribe(unsubscribe)
2179
2136
  raise DestroyedError unless @ptr
2180
2137
  self_p = @ptr
2181
- unsubscribe = String(unsubscribe)
2182
2138
  result = ::CZMQ::FFI.zsock_set_unsubscribe(self_p, unsubscribe)
2183
2139
  result
2184
2140
  end
@@ -2189,11 +2145,10 @@ module CZMQ
2189
2145
  #
2190
2146
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
2191
2147
  # object reference to use this method on
2192
- # @param unsubscribe [String, #to_str, #to_s]
2148
+ # @param unsubscribe [String, #to_s, nil]
2193
2149
  # @return [void]
2194
2150
  def self.set_unsubscribe(self_p, unsubscribe)
2195
2151
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
2196
- unsubscribe = String(unsubscribe)
2197
2152
  result = ::CZMQ::FFI.zsock_set_unsubscribe(self_p, unsubscribe)
2198
2153
  result
2199
2154
  end
@@ -2225,12 +2180,11 @@ module CZMQ
2225
2180
 
2226
2181
  # Set socket option `identity`.
2227
2182
  #
2228
- # @param identity [String, #to_str, #to_s]
2183
+ # @param identity [String, #to_s, nil]
2229
2184
  # @return [void]
2230
2185
  def set_identity(identity)
2231
2186
  raise DestroyedError unless @ptr
2232
2187
  self_p = @ptr
2233
- identity = String(identity)
2234
2188
  result = ::CZMQ::FFI.zsock_set_identity(self_p, identity)
2235
2189
  result
2236
2190
  end
@@ -2241,11 +2195,10 @@ module CZMQ
2241
2195
  #
2242
2196
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
2243
2197
  # object reference to use this method on
2244
- # @param identity [String, #to_str, #to_s]
2198
+ # @param identity [String, #to_s, nil]
2245
2199
  # @return [void]
2246
2200
  def self.set_identity(self_p, identity)
2247
2201
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
2248
- identity = String(identity)
2249
2202
  result = ::CZMQ::FFI.zsock_set_identity(self_p, identity)
2250
2203
  result
2251
2204
  end
@@ -3104,12 +3057,11 @@ module CZMQ
3104
3057
 
3105
3058
  # Set socket option `tcp_accept_filter`.
3106
3059
  #
3107
- # @param tcp_accept_filter [String, #to_str, #to_s]
3060
+ # @param tcp_accept_filter [String, #to_s, nil]
3108
3061
  # @return [void]
3109
3062
  def set_tcp_accept_filter(tcp_accept_filter)
3110
3063
  raise DestroyedError unless @ptr
3111
3064
  self_p = @ptr
3112
- tcp_accept_filter = String(tcp_accept_filter)
3113
3065
  result = ::CZMQ::FFI.zsock_set_tcp_accept_filter(self_p, tcp_accept_filter)
3114
3066
  result
3115
3067
  end
@@ -3120,11 +3072,10 @@ module CZMQ
3120
3072
  #
3121
3073
  # @param self_p [CZMQ::Zsock, #__ptr, ::FFI::Pointer, nil]
3122
3074
  # object reference to use this method on
3123
- # @param tcp_accept_filter [String, #to_str, #to_s]
3075
+ # @param tcp_accept_filter [String, #to_s, nil]
3124
3076
  # @return [void]
3125
3077
  def self.set_tcp_accept_filter(self_p, tcp_accept_filter)
3126
3078
  self_p = self_p.__ptr if self_p.respond_to?(:__ptr)
3127
- tcp_accept_filter = String(tcp_accept_filter)
3128
3079
  result = ::CZMQ::FFI.zsock_set_tcp_accept_filter(self_p, tcp_accept_filter)
3129
3080
  result
3130
3081
  end