Changeset 122 for ruby/trunk/lib/models
- Timestamp:
- May 7, 2009, 9:46:57 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/lib/models/rm/data_types/quantity.rb
r120 r122 8 8 class DV_Ordered < OpenEHR::RM::Data_Types::Basic::Data_Value 9 9 include Comparable 10 attr_ accessor :other_refference_ranges, :normal_range11 attr_accessor :normal_status 12 def initialize(normal_range , other_reference_ranges,10 attr_reader :other_refference_ranges, :normal_range, :normal_status 11 12 def initialize(normal_range=nil, other_reference_ranges=nil, 13 13 normal_status = nil) 14 14 other_reference_ranges_validity(other_reference_ranges) … … 17 17 @normal_status = normal_status 18 18 end 19 19 20 def is_normal? 20 21 !normal_range.nil? or !normal_status.nil 21 22 end 23 22 24 def is_simple? 23 25 normal_status.nil? and other_refference_ranges.nil? 24 26 end 27 28 def <=>(other) 29 raise NotImplementError, 'This method should be implemented' 30 end 31 32 def normal_range=(normal_range) 33 end 34 35 def other_reference_ranges=(other_reference_ranges) 36 end 37 25 38 private 26 39 def other_reference_ranges_validity(other_reference_ranges) … … 50 63 51 64 def add(a_diff) 65 raise NotImplementError, 'add must be implemented' 52 66 end 53 67 54 68 def diff(other) 69 raise NotImplementError, 'diff must be implemented' 55 70 end 56 71 57 72 def subtract(a_diff) 73 raise NotImplementError, 'subtract must be implemented' 74 end 75 end 76 77 class DV_Amount < DV_Quantified 78 attr_reader :accuracy, :accuracy_is_percent 79 def infix(dv_amount, op) 80 raise NotImplementError, 'infix must be implemented' 81 end 82 def accuracy=(accuracy) 83 raise ArgumentError, 'accuracy invalid' 58 84 end 59 85 end
Note:
See TracChangeset
for help on using the changeset viewer.