Sha256: ba19a463a5742e1b0bd3f8d2e089691cf2c200ca80bd110a977be2da8b3c6a1f

Contents?: true

Size: 1.71 KB

Versions: 10

Compression:

Stored size: 1.71 KB

Contents

# Because his module utilise common methods in both rm
# and am, I will integrated to /lib/models/assumed_types.rb.
# By Shinji KOBAYASHI, 2008-07-20
module OpenEhr
  module RM
    module Support
      module AssumedTypes
        class Interval
          attr_accessor :lower, :upper
#          attr_accessor :lower_included, :lower_unbounded
#          attr_accessor :upper_included, :upper_unbounded
          def initialize(lower, upper,
                         lower_included = nil, upper_included = nil)
            if ((lower !=nil) && (upper !=nil)) && lower>upper
              raise ArgumentError, "upper < lower"
            end
            @lower = lower
            @upper = upper
          end
        end

        class List
          attr_reader :content

          def initialize(arg)
            @content = arg
          end

          def first
            @content.first
          end

          def last
            @content.last
          end
        end

        class TIME_DEFINITIONS
        end


        class ISO8601_DATE < TIME_DEFINITIONS
        end

        class ISO8601_TIME < TIME_DEFINITIONS
        end

        class ISO8601_DURATION < TIME_DEFINITIONS
        end

        class ISO8601_DATE_TIME < TIME_DEFINITIONS
        end

        class ISO8601_TIMEZONE < TIME_DEFINITIONS
        end

        class String
          attr_reader :content
          def initialize(arg)
            @content = arg
          end

          def as_integer
            is_integer if is_integer
          end

          def is_empty
          end

          def is_integer
            begin
              Integer(@content)
            rescue
              false
            end
          end
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
open_ehr-1.0.2 lib/open_ehr/rm/support/assumed_types.rb
open_ehr-1.0.1 lib/open_ehr/rm/support/assumed_types.rb
open_ehr-1.0.0 lib/open_ehr/rm/support/assumed_types.rb
open_ehr-0.9.5 lib/open_ehr/rm/support/assumed_types.rb
open_ehr-0.9.4 lib/open_ehr/rm/support/assumed_types.rb
open_ehr-0.9.3 lib/open_ehr/rm/support/assumed_types.rb
open_ehr-0.9.2 lib/open_ehr/rm/support/assumed_types.rb
open_ehr-0.9.1 lib/open_ehr/rm/support/assumed_types.rb
open_ehr-0.9.0 lib/open_ehr/rm/support/assumed_types.rb
open_ehr-0.6.1 lib/open_ehr/rm/support/assumed_types.rb