Class: RTP::ExtendedField
- Defined in:
- lib/rtp-connect/extended_field.rb
Overview
Relations:
-
Parent: Field
-
Children: none
The ExtendedField class.
Constant Summary
Constants inherited from Record
Instance Attribute Summary collapse
-
#accessory_code ⇒ Object
Returns the value of attribute accessory_code.
-
#accessory_type ⇒ Object
Returns the value of attribute accessory_type.
-
#field_id ⇒ Object
Returns the value of attribute field_id.
-
#high_dose_authorization ⇒ Object
Returns the value of attribute high_dose_authorization.
-
#is_fff ⇒ Object
Returns the value of attribute is_fff.
-
#original_beam_name ⇒ Object
Returns the value of attribute original_beam_name.
-
#original_beam_number ⇒ Object
Returns the value of attribute original_beam_number.
-
#original_plan_uid ⇒ Object
Returns the value of attribute original_plan_uid.
-
#parent ⇒ Object
The Record which this instance belongs to.
-
#referenced_rt_plan_relationship ⇒ Object
Returns the value of attribute referenced_rt_plan_relationship.
-
#referenced_rt_plan_uid ⇒ Object
Returns the value of attribute referenced_rt_plan_uid.
Attributes inherited from Record
Class Method Summary collapse
-
.load(string, parent) ⇒ ExtendedField
Creates a new (treatment) ExtendedField by parsing a RTPConnect string line.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
(also: #eql?)
Checks for equality.
-
#children ⇒ Array
Gives an empty array, as these instances are child-less by definition.
-
#hash ⇒ Fixnum
Computes a hash code for this object.
-
#initialize(parent) ⇒ ExtendedField
constructor
Creates a new (treatment) ExtendedField.
-
#to_extended_field ⇒ ExtendedField
Returns self.
Methods inherited from Record
#encode, #get_parent, #load, #to_record, #to_s, #values
Constructor Details
#initialize(parent) ⇒ ExtendedField
Creates a new (treatment) ExtendedField.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# 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 |
Instance Attribute Details
#accessory_code ⇒ Object
Returns the value of attribute accessory_code.
18 19 20 |
# File 'lib/rtp-connect/extended_field.rb', line 18 def accessory_code @accessory_code end |
#accessory_type ⇒ Object
Returns the value of attribute accessory_type.
19 20 21 |
# File 'lib/rtp-connect/extended_field.rb', line 19 def accessory_type @accessory_type end |
#field_id ⇒ Object
Returns the value of attribute field_id.
13 14 15 |
# File 'lib/rtp-connect/extended_field.rb', line 13 def field_id @field_id end |
#high_dose_authorization ⇒ Object
Returns the value of attribute high_dose_authorization.
20 21 22 |
# File 'lib/rtp-connect/extended_field.rb', line 20 def @high_dose_authorization end |
#is_fff ⇒ Object
Returns the value of attribute is_fff.
17 18 19 |
# File 'lib/rtp-connect/extended_field.rb', line 17 def is_fff @is_fff end |
#original_beam_name ⇒ Object
Returns the value of attribute original_beam_name.
16 17 18 |
# File 'lib/rtp-connect/extended_field.rb', line 16 def original_beam_name @original_beam_name end |
#original_beam_number ⇒ Object
Returns the value of attribute original_beam_number.
15 16 17 |
# File 'lib/rtp-connect/extended_field.rb', line 15 def original_beam_number @original_beam_number end |
#original_plan_uid ⇒ Object
Returns the value of attribute original_plan_uid.
14 15 16 |
# File 'lib/rtp-connect/extended_field.rb', line 14 def original_plan_uid @original_plan_uid end |
#parent ⇒ Object
The Record which this instance belongs to.
12 13 14 |
# File 'lib/rtp-connect/extended_field.rb', line 12 def parent @parent end |
#referenced_rt_plan_relationship ⇒ Object
Returns the value of attribute referenced_rt_plan_relationship.
22 23 24 |
# File 'lib/rtp-connect/extended_field.rb', line 22 def referenced_rt_plan_relationship @referenced_rt_plan_relationship end |
#referenced_rt_plan_uid ⇒ Object
Returns the value of attribute referenced_rt_plan_uid.
21 22 23 |
# File 'lib/rtp-connect/extended_field.rb', line 21 def referenced_rt_plan_uid @referenced_rt_plan_uid end |
Class Method Details
.load(string, parent) ⇒ ExtendedField
Creates a new (treatment) ExtendedField by parsing a RTPConnect string line.
31 32 33 34 |
# File 'lib/rtp-connect/extended_field.rb', line 31 def self.load(string, parent) ef = self.new(parent) ef.load(string) end |
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Checks for equality.
Other and self are considered equivalent if they are of compatible types and their attributes are equivalent.
70 71 72 73 74 |
# File 'lib/rtp-connect/extended_field.rb', line 70 def ==(other) if other.respond_to?(:to_extended_field) other.send(:state) == state end end |
#children ⇒ Array
Gives an empty array, as these instances are child-less by definition.
82 83 84 |
# File 'lib/rtp-connect/extended_field.rb', line 82 def children return Array.new end |
#hash ⇒ Fixnum
Two objects with the same attributes will have the same hash code.
Computes a hash code for this object.
92 93 94 |
# File 'lib/rtp-connect/extended_field.rb', line 92 def hash state.hash end |
#to_extended_field ⇒ ExtendedField
Returns self.
100 101 102 |
# File 'lib/rtp-connect/extended_field.rb', line 100 def to_extended_field self end |