source: ruby/trunk/lib/models/rm/support/assumed_types.rb@ 47

Last change on this file since 47 was 47, checked in by Tatsukawa, Akimichi, 16 years ago

Unit tests for adl_parser fails

File size: 1.6 KB
Line 
1module OpenEHR
2 module RM
3 module Support
4 module Assumed_Types
5 class Interval
6 attr_accessor :lower, :upper
7# attr_accessor :lower_included, :lower_unbounded
8# attr_accessor :upper_included, :upper_unbounded
9 def initialize(lower, upper,
10 lower_included = nil, upper_included = nil)
11 if ((lower !=nil) && (upper !=nil)) && lower>upper
12 raise ArgumentError, "upper < lower"
13 end
14 @lower = lower
15 @upper = upper
16 end
17 end
18
19 class List
20 attr_reader :content
21
22 def initialize(arg)
23 @content = arg
24 end
25
26 def first
27 @content.first
28 end
29
30 def last
31 @content.last
32 end
33 end
34
35 class TIME_DEFINITIONS
36 end
37
38
39 class ISO8601_DATE < TIME_DEFINITIONS
40 end
41
42 class ISO8601_TIME < TIME_DEFINITIONS
43 end
44
45 class ISO8601_DURATION < TIME_DEFINITIONS
46 end
47
48 class ISO8601_DATE_TIME < TIME_DEFINITIONS
49 end
50
51 class ISO8601_TIMEZONE < TIME_DEFINITIONS
52 end
53
54 class String
55 attr_reader :content
56 def initialize(arg)
57 @content = arg
58 end
59
60 def as_integer
61 is_integer if is_integer
62 end
63
64 def is_empty
65 end
66
67 def is_integer
68 begin
69 Integer(@content)
70 rescue
71 false
72 end
73 end
74 end
75 end
76 end
77 end
78end
Note: See TracBrowser for help on using the repository browser.