source: ruby/trunk/lib/open_ehr/am/archetype/assertion.rb@ 384

Last change on this file since 384 was 384, checked in by KOBAYASHI, Shinji, 14 years ago

refs #73

File size: 1.2 KB
Line 
1module OpenEHR
2 module AM
3 module Archetype
4 module Assertion
5 class Assertion
6 attr_reader :expression, :tag
7 attr_accessor :string_expression, :variables
8
9 def initialize(args = { })
10 self.expression = args[:expression]
11 self.tag = args[:tag]
12 self.string_expression = args[:string_expression]
13 self.variables = args[:variables]
14 end
15
16 def expression=(expression)
17 if expression.nil? or expression.type.upcase != 'BOOLEAN'
18 raise ArgumentError, 'invalid expression'
19 end
20 @expression = expression
21 end
22
23 def tag=(tag)
24 if !tag.nil? && tag.empty?
25 raise ArgumentError, 'tag should not be empty'
26 end
27 @tag = tag
28 end
29 end
30
31 class ExprItem
32 attr_reader :type
33
34 def initialize(args = { })
35 self.type = args[:type]
36 end
37
38 def type=(type)
39 if type.nil? or type.empty?
40 raise ArgumentError, 'type is mandatory'
41 end
42 @type = type
43 end
44 end
45 end # of Assetion
46 end # of Archtype
47 end #of AM
48end # of OpenEHR
Note: See TracBrowser for help on using the repository browser.