Class: RTP::ExtendedPlan
- Defined in:
- lib/rtp-connect/extended_plan.rb
Overview
Relations:
-
Parent: Plan
-
Children: none
The Extended plan class.
Constant Summary
Constants inherited from Record
Instance Attribute Summary collapse
-
#encoding ⇒ Object
Returns the value of attribute encoding.
-
#fullname ⇒ Object
Returns the value of attribute fullname.
-
#parent ⇒ Object
The Record which this instance belongs to.
-
#patient_comments ⇒ Object
Returns the value of attribute patient_comments.
Attributes inherited from Record
Class Method Summary collapse
-
.load(string, parent) ⇒ ExtendedPlan
Creates a new ExtendedPlan 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) ⇒ ExtendedPlan
constructor
Creates a new ExtendedPlan.
-
#to_extended_plan ⇒ ExtendedPlan
Returns self.
Methods inherited from Record
#encode, #get_parent, #load, #to_record, #to_s, #values
Constructor Details
#initialize(parent) ⇒ ExtendedPlan
Creates a new ExtendedPlan.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rtp-connect/extended_plan.rb', line 33 def initialize(parent) super('EXTENDED_PLAN_DEF', 4, 5) # Parent relation (may get more than one type of record here): @parent = get_parent(parent.to_record, Plan) @parent.add_extended_plan(self) @attributes = [ # Required: :keyword, :encoding, :fullname, # Optional: :patient_comments ] end |
Instance Attribute Details
#encoding ⇒ Object
Returns the value of attribute encoding.
13 14 15 |
# File 'lib/rtp-connect/extended_plan.rb', line 13 def encoding @encoding end |
#fullname ⇒ Object
Returns the value of attribute fullname.
14 15 16 |
# File 'lib/rtp-connect/extended_plan.rb', line 14 def fullname @fullname end |
#parent ⇒ Object
The Record which this instance belongs to.
12 13 14 |
# File 'lib/rtp-connect/extended_plan.rb', line 12 def parent @parent end |
#patient_comments ⇒ Object
Returns the value of attribute patient_comments.
15 16 17 |
# File 'lib/rtp-connect/extended_plan.rb', line 15 def patient_comments @patient_comments end |
Class Method Details
.load(string, parent) ⇒ ExtendedPlan
Creates a new ExtendedPlan by parsing a RTPConnect string line.
24 25 26 27 |
# File 'lib/rtp-connect/extended_plan.rb', line 24 def self.load(string, parent) ep = self.new(parent) ep.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.
56 57 58 59 60 |
# File 'lib/rtp-connect/extended_plan.rb', line 56 def ==(other) if other.respond_to?(:to_extended_plan) other.send(:state) == state end end |
#children ⇒ Array
Gives an empty array, as these instances are child-less by definition.
68 69 70 |
# File 'lib/rtp-connect/extended_plan.rb', line 68 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.
78 79 80 |
# File 'lib/rtp-connect/extended_plan.rb', line 78 def hash state.hash end |
#to_extended_plan ⇒ ExtendedPlan
Returns self.
86 87 88 |
# File 'lib/rtp-connect/extended_plan.rb', line 86 def to_extended_plan self end |