rtp-connect 1.0 → 1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -24,10 +24,8 @@ module RTP
24
24
  # * <tt>parent</tt> -- A Record which is used to determine the proper parent of this instance.
25
25
  #
26
26
  def self.load(string, parent)
27
- raise ArgumentError, "Invalid argument 'string'. Expected String, got #{string.class}." unless string.is_a?(String)
28
- raise ArgumentError, "Invalid argument 'parent'. Expected RTP::Record, got #{parent.class}." unless parent.is_a?(RTP::Record)
29
27
  # Get the quote-less values:
30
- values = string.values
28
+ values = string.to_s.values
31
29
  raise ArgumentError, "Invalid argument 'string': Expected exactly 6 elements, got #{values.length}." unless values.length == 6
32
30
  f = self.new(parent)
33
31
  # Assign the values to attributes:
@@ -47,19 +45,34 @@ module RTP
47
45
  # * <tt>parent</tt> -- A Record which is used to determine the proper parent of this instance.
48
46
  #
49
47
  def initialize(parent)
50
- raise ArgumentError, "Invalid argument 'parent'. Expected RTP::Record, got #{parent.class}." unless parent.is_a?(RTP::Record)
51
- # Parent relation:
52
- @parent = get_parent(parent, Field)
48
+ # Parent relation (may get more than one type of record here):
49
+ @parent = get_parent(parent.to_record, Field)
53
50
  @parent.add_extended_field(self)
54
51
  @keyword = 'EXTENDED_FIELD_DEF'
55
52
  end
56
53
 
54
+ # Returns true if the argument is an instance with attributes equal to self.
55
+ #
56
+ def ==(other)
57
+ if other.respond_to?(:to_extended_field)
58
+ other.send(:state) == state
59
+ end
60
+ end
61
+
62
+ alias_method :eql?, :==
63
+
57
64
  # Returns an empty array, as these instances are child-less by definition.
58
65
  #
59
66
  def children
60
67
  return Array.new
61
68
  end
62
69
 
70
+ # Generates a Fixnum hash value for this instance.
71
+ #
72
+ def hash
73
+ state.hash
74
+ end
75
+
63
76
  # Returns the values of this instance in an array.
64
77
  # The values does not include the CRC.
65
78
  #
@@ -73,55 +86,67 @@ module RTP
73
86
  ]
74
87
  end
75
88
 
89
+ # Returns self.
90
+ #
91
+ def to_extended_field
92
+ self
93
+ end
94
+
76
95
  # Writes the ExtendedField object + any hiearchy of child objects,
77
96
  # to a properly formatted RTPConnect ascii string.
78
97
  #
79
- def to_str
98
+ def to_s
80
99
  str = encode
81
100
  if children
82
101
  children.each do |child|
83
- str += child.to_str
102
+ str += child.to_s
84
103
  end
85
104
  end
86
105
  return str
87
106
  end
88
107
 
108
+ alias :to_str :to_s
109
+
89
110
  # Sets the keyword attribute.
90
111
  #
91
112
  def keyword=(value)
92
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
93
- raise ArgumentError, "Invalid keyword. Expected 'EXTENDED_FIELD_DEF', got #{value}." unless value.upcase == "EXTENDED_FIELD_DEF"
113
+ value = value.to_s.upcase
114
+ raise ArgumentError, "Invalid keyword. Expected 'EXTENDED_FIELD_DEF', got #{value}." unless value == "EXTENDED_FIELD_DEF"
94
115
  @keyword = value
95
116
  end
96
117
 
97
118
  # Sets the field_id attribute.
98
119
  #
99
120
  def field_id=(value)
100
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
101
- @field_id = value
121
+ @field_id = value && value.to_s
102
122
  end
103
123
 
104
124
  # Sets the original_plan_uid attribute.
105
125
  #
106
126
  def original_plan_uid=(value)
107
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
108
- @original_plan_uid = value
127
+ @original_plan_uid = value && value.to_s
109
128
  end
110
129
 
111
130
  # Sets the original_beam_number attribute.
112
131
  #
113
132
  def original_beam_number=(value)
114
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
115
- @original_beam_number = value
133
+ @original_beam_number = value && value.to_s
116
134
  end
117
135
 
118
136
  # Sets the original_beam_name attribute.
119
137
  #
120
138
  def original_beam_name=(value)
121
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
122
- @original_beam_name = value
139
+ @original_beam_name = value && value.to_s
123
140
  end
124
141
 
142
+
143
+ private
144
+
145
+
146
+ # Returns the attributes of this instance in an array (for comparison purposes).
147
+ #
148
+ alias_method :state, :values
149
+
125
150
  end
126
151
 
127
152
  end
@@ -71,10 +71,8 @@ module RTP
71
71
  # * <tt>parent</tt> -- A Record which is used to determine the proper parent of this instance.
72
72
  #
73
73
  def self.load(string, parent)
74
- raise ArgumentError, "Invalid argument 'string'. Expected String, got #{string.class}." unless string.is_a?(String)
75
- raise ArgumentError, "Invalid argument 'parent'. Expected RTP::Record, got #{parent.class}." unless parent.is_a?(RTP::Record)
76
74
  # Get the quote-less values:
77
- values = string.values
75
+ values = string.to_s.values
78
76
  raise ArgumentError, "Invalid argument 'string': Expected exactly 49 elements, got #{values.length}." unless values.length == 49
79
77
  f = self.new(parent)
80
78
  # Assign the values to attributes:
@@ -137,28 +135,35 @@ module RTP
137
135
  # * <tt>parent</tt> -- A Record which is used to determine the proper parent of this instance.
138
136
  #
139
137
  def initialize(parent)
140
- raise ArgumentError, "Invalid argument 'parent'. Expected RTP::Record, got #{parent.class}." unless parent.is_a?(RTP::Record)
141
138
  # Child records:
142
139
  @control_points = Array.new
143
140
  @extended_field = nil
144
- # Parent relation:
145
- @parent = get_parent(parent, Prescription)
141
+ # Parent relation (may get more than one type of record here):
142
+ @parent = get_parent(parent.to_record, Prescription)
146
143
  @parent.add_field(self)
147
144
  @keyword = 'FIELD_DEF'
148
145
  end
149
146
 
147
+ # Returns true if the argument is an instance with attributes equal to self.
148
+ #
149
+ def ==(other)
150
+ if other.respond_to?(:to_field)
151
+ other.send(:state) == state
152
+ end
153
+ end
154
+
155
+ alias_method :eql?, :==
156
+
150
157
  # Adds a control point record to this instance.
151
158
  #
152
159
  def add_control_point(child)
153
- raise ArgumentError, "Invalid argument 'child'. Expected RTP::ControlPoint, got #{child.class}." unless child.is_a?(RTP::ControlPoint)
154
- @control_points << child
160
+ @control_points << child.to_control_point
155
161
  end
156
162
 
157
163
  # Connects an extended treatment field record to this instance.
158
164
  #
159
165
  def add_extended_field(child)
160
- raise ArgumentError, "Invalid argument 'child'. Expected RTP::ExtendedField, got #{child.class}." unless child.is_a?(RTP::ExtendedField)
161
- @extended_field = child
166
+ @extended_field = child.to_extended_field
162
167
  end
163
168
 
164
169
  # Returns nil, as these instances are child-less by definition.
@@ -167,6 +172,12 @@ module RTP
167
172
  return [@extended_field, @control_points].flatten.compact
168
173
  end
169
174
 
175
+ # Generates a Fixnum hash value for this instance.
176
+ #
177
+ def hash
178
+ state.hash
179
+ end
180
+
170
181
  # Returns the values of this instance in an array.
171
182
  # The values does not include the CRC.
172
183
  #
@@ -223,356 +234,325 @@ module RTP
223
234
  ]
224
235
  end
225
236
 
237
+ # Returns self.
238
+ #
239
+ def to_field
240
+ self
241
+ end
242
+
226
243
  # Writes the Field object + any hiearchy of child objects,
227
244
  # to a properly formatted RTPConnect ascii string.
228
245
  #
229
- def to_str
246
+ def to_s
230
247
  str = encode
231
248
  if children
232
249
  children.each do |child|
233
- str += child.to_str
250
+ str += child.to_s
234
251
  end
235
252
  end
236
253
  return str
237
254
  end
238
255
 
256
+ alias :to_str :to_s
257
+
239
258
  # Sets the keyword attribute.
240
259
  #
241
260
  def keyword=(value)
242
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
243
- raise ArgumentError, "Invalid keyword. Expected 'FIELD_DEF', got #{value}." unless value.upcase == "FIELD_DEF"
261
+ value = value.to_s.upcase
262
+ raise ArgumentError, "Invalid keyword. Expected 'FIELD_DEF', got #{value}." unless value == "FIELD_DEF"
244
263
  @keyword = value
245
264
  end
246
265
 
247
266
  # Sets the rx_site_name attribute.
248
267
  #
249
268
  def rx_site_name=(value)
250
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
251
- @rx_site_name = value
269
+ @rx_site_name = value && value.to_s
252
270
  end
253
271
 
254
272
  # Sets the field_name attribute.
255
273
  #
256
274
  def field_name=(value)
257
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
258
- @field_name = value
275
+ @field_name = value && value.to_s
259
276
  end
260
277
 
261
278
  # Sets the field_id attribute.
262
279
  #
263
280
  def field_id=(value)
264
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
265
- @field_id = value
281
+ @field_id = value && value.to_s
266
282
  end
267
283
 
268
284
  # Sets the field_note attribute.
269
285
  #
270
286
  def field_note=(value)
271
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
272
- @field_note = value
287
+ @field_note = value && value.to_s
273
288
  end
274
289
 
275
290
  # Sets the field_dose attribute.
276
291
  #
277
292
  def field_dose=(value)
278
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
279
- @field_dose = value
293
+ @field_dose = value && value.to_s
280
294
  end
281
295
 
282
296
  # Sets the field_monitor_units attribute.
283
297
  #
284
298
  def field_monitor_units=(value)
285
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
286
- @field_monitor_units = value
299
+ @field_monitor_units = value && value.to_s
287
300
  end
288
301
 
289
302
  # Sets the wedge_monitor_units attribute.
290
303
  #
291
304
  def wedge_monitor_units=(value)
292
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
293
- @wedge_monitor_units = value
305
+ @wedge_monitor_units = value && value.to_s
294
306
  end
295
307
 
296
308
  # Sets the treatment_machine attribute.
297
309
  #
298
310
  def treatment_machine=(value)
299
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
300
- @treatment_machine = value
311
+ @treatment_machine = value && value.to_s
301
312
  end
302
313
 
303
314
  # Sets the treatment_type attribute.
304
315
  #
305
316
  def treatment_type=(value)
306
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
307
- @treatment_type = value
317
+ @treatment_type = value && value.to_s
308
318
  end
309
319
 
310
320
  # Sets the modality attribute.
311
321
  #
312
322
  def modality=(value)
313
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
314
- @modality = value
323
+ @modality = value && value.to_s
315
324
  end
316
325
 
317
326
  # Sets the energy attribute.
318
327
  #
319
328
  def energy=(value)
320
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
321
- @energy = value
329
+ @energy = value && value.to_s
322
330
  end
323
331
 
324
332
  # Sets the time attribute.
325
333
  #
326
334
  def time=(value)
327
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
328
- @time = value
335
+ @time = value && value.to_s
329
336
  end
330
337
 
331
338
  # Sets the doserate attribute.
332
339
  #
333
340
  def doserate=(value)
334
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
335
- @doserate = value
341
+ @doserate = value && value.to_s
336
342
  end
337
343
 
338
344
  # Sets the sad attribute.
339
345
  #
340
346
  def sad=(value)
341
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
342
- @sad = value
347
+ @sad = value && value.to_s
343
348
  end
344
349
 
345
350
  # Sets the ssd attribute.
346
351
  #
347
352
  def ssd=(value)
348
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
349
- @ssd = value
353
+ @ssd = value && value.to_s
350
354
  end
351
355
 
352
356
  # Sets the gantry_angle attribute.
353
357
  #
354
358
  def gantry_angle=(value)
355
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
356
- @gantry_angle = value
359
+ @gantry_angle = value && value.to_s
357
360
  end
358
361
 
359
362
  # Sets the collimator_angle attribute.
360
363
  #
361
364
  def collimator_angle=(value)
362
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
363
- @collimator_angle = value
365
+ @collimator_angle = value && value.to_s
364
366
  end
365
367
 
366
368
  # Sets the field_x_mode attribute.
367
369
  #
368
370
  def field_x_mode=(value)
369
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
370
- @field_x_mode = value
371
+ @field_x_mode = value && value.to_s
371
372
  end
372
373
 
373
374
  # Sets the field_x attribute.
374
375
  #
375
376
  def field_x=(value)
376
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
377
- @field_x = value
377
+ @field_x = value && value.to_s
378
378
  end
379
379
 
380
380
  # Sets the collimator_x1 attribute.
381
381
  #
382
382
  def collimator_x1=(value)
383
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
384
- @collimator_x1 = value
383
+ @collimator_x1 = value && value.to_s
385
384
  end
386
385
 
387
386
  # Sets the collimator_x2 attribute.
388
387
  #
389
388
  def collimator_x2=(value)
390
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
391
- @collimator_x2 = value
389
+ @collimator_x2 = value && value.to_s
392
390
  end
393
391
 
394
392
  # Sets the field_y_mode attribute.
395
393
  #
396
394
  def field_y_mode=(value)
397
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
398
- @field_y_mode = value
395
+ @field_y_mode = value && value.to_s
399
396
  end
400
397
 
401
398
  # Sets the field_y attribute.
402
399
  #
403
400
  def field_y=(value)
404
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
405
- @field_y = value
401
+ @field_y = value && value.to_s
406
402
  end
407
403
 
408
404
  # Sets the collimator_y1 attribute.
409
405
  #
410
406
  def collimator_y1=(value)
411
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
412
- @collimator_y1 = value
407
+ @collimator_y1 = value && value.to_s
413
408
  end
414
409
 
415
410
  # Sets the collimator_y2 attribute.
416
411
  #
417
412
  def collimator_y2=(value)
418
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
419
- @collimator_y2 = value
413
+ @collimator_y2 = value && value.to_s
420
414
  end
421
415
 
422
416
  # Sets the couch_vertical attribute.
423
417
  #
424
418
  def couch_vertical=(value)
425
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
426
- @couch_vertical = value
419
+ @couch_vertical = value && value.to_s
427
420
  end
428
421
 
429
422
  # Sets the couch_lateral attribute.
430
423
  #
431
424
  def couch_lateral=(value)
432
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
433
- @couch_lateral = value
425
+ @couch_lateral = value && value.to_s
434
426
  end
435
427
 
436
428
  # Sets the couch_longitudinal attribute.
437
429
  #
438
430
  def couch_longitudinal=(value)
439
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
440
- @couch_longitudinal = value
431
+ @couch_longitudinal = value && value.to_s
441
432
  end
442
433
 
443
434
  # Sets the couch_angle attribute.
444
435
  #
445
436
  def couch_angle=(value)
446
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
447
- @couch_angle = value
437
+ @couch_angle = value && value.to_s
448
438
  end
449
439
 
450
440
  # Sets the couch_pedestal attribute.
451
441
  #
452
442
  def couch_pedestal=(value)
453
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
454
- @couch_pedestal = value
443
+ @couch_pedestal = value && value.to_s
455
444
  end
456
445
 
457
446
  # Sets the tolerance_table attribute.
458
447
  #
459
448
  def tolerance_table=(value)
460
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
461
- @tolerance_table = value
449
+ @tolerance_table = value && value.to_s
462
450
  end
463
451
 
464
452
  # Sets the arc_direction attribute.
465
453
  #
466
454
  def arc_direction=(value)
467
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
468
- @arc_direction = value
455
+ @arc_direction = value && value.to_s
469
456
  end
470
457
 
471
458
  # Sets the arc_start_angle attribute.
472
459
  #
473
460
  def arc_start_angle=(value)
474
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
475
- @arc_start_angle = value
461
+ @arc_start_angle = value && value.to_s
476
462
  end
477
463
 
478
464
  # Sets the arc_stop_angle attribute.
479
465
  #
480
466
  def arc_stop_angle=(value)
481
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
482
- @arc_stop_angle = value
467
+ @arc_stop_angle = value && value.to_s
483
468
  end
484
469
 
485
470
  # Sets the arc_mu_degree attribute.
486
471
  #
487
472
  def arc_mu_degree=(value)
488
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
489
- @arc_mu_degree = value
473
+ @arc_mu_degree = value && value.to_s
490
474
  end
491
475
 
492
476
  # Sets the wedge attribute.
493
477
  #
494
478
  def wedge=(value)
495
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
496
- @wedge = value
479
+ @wedge = value && value.to_s
497
480
  end
498
481
 
499
482
  # Sets the dynamic_wedge attribute.
500
483
  #
501
484
  def dynamic_wedge=(value)
502
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
503
- @dynamic_wedge = value
485
+ @dynamic_wedge = value && value.to_s
504
486
  end
505
487
 
506
488
  # Sets the block attribute.
507
489
  #
508
490
  def block=(value)
509
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
510
- @block = value
491
+ @block = value && value.to_s
511
492
  end
512
493
 
513
494
  # Sets the compensator attribute.
514
495
  #
515
496
  def compensator=(value)
516
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
517
- @compensator = value
497
+ @compensator = value && value.to_s
518
498
  end
519
499
 
520
500
  # Sets the e_applicator attribute.
521
501
  #
522
502
  def e_applicator=(value)
523
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
524
- @e_applicator = value
503
+ @e_applicator = value && value.to_s
525
504
  end
526
505
 
527
506
  # Sets the e_field_def_aperture attribute.
528
507
  #
529
508
  def e_field_def_aperture=(value)
530
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
531
- @e_field_def_aperture = value
509
+ @e_field_def_aperture = value && value.to_s
532
510
  end
533
511
 
534
512
  # Sets the bolus attribute.
535
513
  #
536
514
  def bolus=(value)
537
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
538
- @bolus = value
515
+ @bolus = value && value.to_s
539
516
  end
540
517
 
541
518
  # Sets the portfilm_mu_open attribute.
542
519
  #
543
520
  def portfilm_mu_open=(value)
544
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
545
- @portfilm_mu_open = value
521
+ @portfilm_mu_open = value && value.to_s
546
522
  end
547
523
 
548
524
  # Sets the portfilm_coeff_open attribute.
549
525
  #
550
526
  def portfilm_coeff_open=(value)
551
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
552
- @portfilm_coeff_open = value
527
+ @portfilm_coeff_open = value && value.to_s
553
528
  end
554
529
 
555
530
  # Sets the portfilm_delta_open attribute.
556
531
  #
557
532
  def portfilm_delta_open=(value)
558
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
559
- @portfilm_delta_open = value
533
+ @portfilm_delta_open = value && value.to_s
560
534
  end
561
535
 
562
536
  # Sets the portfilm_mu_treat attribute.
563
537
  #
564
538
  def portfilm_mu_treat=(value)
565
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
566
- @portfilm_mu_treat = value
539
+ @portfilm_mu_treat = value && value.to_s
567
540
  end
568
541
 
569
542
  # Sets the portfilm_coeff_treat attribute.
570
543
  #
571
544
  def portfilm_coeff_treat=(value)
572
- raise ArgumentError, "Invalid argument 'value'. Expected String, got #{value.class}." unless value.is_a?(String)
573
- @portfilm_coeff_treat = value
545
+ @portfilm_coeff_treat = value && value.to_s
574
546
  end
575
547
 
548
+
549
+ private
550
+
551
+
552
+ # Returns the attributes of this instance in an array (for comparison purposes).
553
+ #
554
+ alias_method :state, :values
555
+
576
556
  end
577
557
 
578
558
  end