class RTP::ExtendedField
The ExtendedField
class.
@note Relations:
* Parent: Field * Children: none
Attributes
The Record
which this instance belongs to.
Public Class Methods
Creates a new (treatment) ExtendedField
by parsing a RTPConnect string line.
@param [#to_s] string the extended treatment field definition record string line @param [Record] parent a record which is used to determine the proper parent of this instance @return [ExtendedField] the created ExtendedField
instance @raise [ArgumentError] if given a string containing an invalid number of elements
# File lib/rtp-connect/extended_field.rb, line 31 def self.load(string, parent) ef = self.new(parent) ef.load(string) end
Creates a new (treatment) ExtendedField
.
@param [Record] parent a record which is used to determine the proper parent of this instance
# File lib/rtp-connect/extended_field.rb, line 40 def initialize(parent) super('EXTENDED_FIELD_DEF', 4, 12) # Parent relation (may get more than one type of record here): @parent = get_parent(parent.to_record, Field) @parent.add_extended_field(self) @attributes = [ # Required: :keyword, :field_id, :original_plan_uid, # Optional: :original_beam_number, :original_beam_name, :is_fff, :accessory_code, :accessory_type, :high_dose_authorization, :referenced_rt_plan_uid, :referenced_rt_plan_relationship ] end
Public Instance Methods
Checks for equality.
Other and self are considered equivalent if they are of compatible types and their attributes are equivalent.
@param other an object to be compared with self. @return [Boolean] true if self and other are considered equivalent
# File lib/rtp-connect/extended_field.rb, line 70 def ==(other) if other.respond_to?(:to_extended_field) other.send(:state) == state end end
Sets the accessory_code
attribute.
@param [nil, to_s] value the new attribute value
# File lib/rtp-connect/extended_field.rb, line 148 def accessory_code=(value) @accessory_code = value && value.to_s end
Sets the accessory_type
attribute.
@param [nil, to_s] value the new attribute value
# File lib/rtp-connect/extended_field.rb, line 156 def accessory_type=(value) @accessory_type = value && value.to_s end
Gives an empty array, as these instances are child-less by definition.
@return [Array] an emtpy array
# File lib/rtp-connect/extended_field.rb, line 82 def children return Array.new end
Sets the field_id
attribute.
@param [nil, to_s] value the new attribute value
# File lib/rtp-connect/extended_field.rb, line 108 def field_id=(value) @field_id = value && value.to_s end
Computes a hash code for this object.
@note Two objects with the same attributes will have the same hash code.
@return [Fixnum] the object's hash code
# File lib/rtp-connect/extended_field.rb, line 92 def hash state.hash end
Sets the is_fff
attribute.
@param [nil, to_s] value the new attribute value
# File lib/rtp-connect/extended_field.rb, line 140 def is_fff=(value) @is_fff = value && value.to_s end
Sets the original_beam_name
attribute.
@param [nil, to_s] value the new attribute value
# File lib/rtp-connect/extended_field.rb, line 132 def original_beam_name=(value) @original_beam_name = value && value.to_s end
Sets the original_beam_number
attribute.
@param [nil, to_s] value the new attribute value
# File lib/rtp-connect/extended_field.rb, line 124 def original_beam_number=(value) @original_beam_number = value && value.to_s end
Sets the original_plan_uid
attribute.
@param [nil, to_s] value the new attribute value
# File lib/rtp-connect/extended_field.rb, line 116 def original_plan_uid=(value) @original_plan_uid = value && value.to_s end
Sets the referenced_rt_plan_relationship
attribute.
@param [nil, to_s] value the new attribute value
# File lib/rtp-connect/extended_field.rb, line 180 def referenced_rt_plan_relationship=(value) @referenced_rt_plan_relationship = value && value.to_s end
Sets the referenced_rt_plan_uid
attribute.
@param [nil, to_s] value the new attribute value
# File lib/rtp-connect/extended_field.rb, line 172 def referenced_rt_plan_uid=(value) @referenced_rt_plan_uid = value && value.to_s end
Returns self.
@return [ExtendedField] self
# File lib/rtp-connect/extended_field.rb, line 100 def to_extended_field self end