Rev | Line | |
---|
[85] | 1 | # Because his module utilise common methods in both rm
|
---|
| 2 | # and am, I will integrated to /lib/models/assumed_types.rb.
|
---|
| 3 | # By Shinji KOBAYASHI, 2008-07-20
|
---|
[4] | 4 | module OpenEHR
|
---|
| 5 | module RM
|
---|
| 6 | module Support
|
---|
| 7 | module Assumed_Types
|
---|
| 8 | class Interval
|
---|
| 9 | attr_accessor :lower, :upper
|
---|
| 10 | # attr_accessor :lower_included, :lower_unbounded
|
---|
| 11 | # attr_accessor :upper_included, :upper_unbounded
|
---|
| 12 | def initialize(lower, upper,
|
---|
| 13 | lower_included = nil, upper_included = nil)
|
---|
| 14 | if ((lower !=nil) && (upper !=nil)) && lower>upper
|
---|
| 15 | raise ArgumentError, "upper < lower"
|
---|
| 16 | end
|
---|
| 17 | @lower = lower
|
---|
| 18 | @upper = upper
|
---|
| 19 | end
|
---|
| 20 | end
|
---|
[47] | 21 |
|
---|
| 22 | class List
|
---|
| 23 | attr_reader :content
|
---|
| 24 |
|
---|
| 25 | def initialize(arg)
|
---|
| 26 | @content = arg
|
---|
| 27 | end
|
---|
| 28 |
|
---|
| 29 | def first
|
---|
| 30 | @content.first
|
---|
| 31 | end
|
---|
| 32 |
|
---|
| 33 | def last
|
---|
| 34 | @content.last
|
---|
| 35 | end
|
---|
| 36 | end
|
---|
| 37 |
|
---|
| 38 | class TIME_DEFINITIONS
|
---|
| 39 | end
|
---|
| 40 |
|
---|
| 41 |
|
---|
| 42 | class ISO8601_DATE < TIME_DEFINITIONS
|
---|
| 43 | end
|
---|
| 44 |
|
---|
| 45 | class ISO8601_TIME < TIME_DEFINITIONS
|
---|
| 46 | end
|
---|
| 47 |
|
---|
| 48 | class ISO8601_DURATION < TIME_DEFINITIONS
|
---|
| 49 | end
|
---|
| 50 |
|
---|
| 51 | class ISO8601_DATE_TIME < TIME_DEFINITIONS
|
---|
| 52 | end
|
---|
| 53 |
|
---|
| 54 | class ISO8601_TIMEZONE < TIME_DEFINITIONS
|
---|
| 55 | end
|
---|
| 56 |
|
---|
| 57 | class String
|
---|
| 58 | attr_reader :content
|
---|
| 59 | def initialize(arg)
|
---|
| 60 | @content = arg
|
---|
| 61 | end
|
---|
| 62 |
|
---|
| 63 | def as_integer
|
---|
| 64 | is_integer if is_integer
|
---|
| 65 | end
|
---|
| 66 |
|
---|
| 67 | def is_empty
|
---|
| 68 | end
|
---|
| 69 |
|
---|
| 70 | def is_integer
|
---|
| 71 | begin
|
---|
| 72 | Integer(@content)
|
---|
| 73 | rescue
|
---|
| 74 | false
|
---|
| 75 | end
|
---|
| 76 | end
|
---|
| 77 | end
|
---|
[4] | 78 | end
|
---|
| 79 | end
|
---|
| 80 | end
|
---|
| 81 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.