Ignore:
Timestamp:
Aug 20, 2009, 8:16:53 PM (15 years ago)
Author:
KOBAYASHI, Shinji
Message:

move from Test:Unit to RSpec

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/0.5/lib/open_ehr/rm/data_types/basic.rb

    r195 r216  
    22# http://www.openehr.org/uml/release-1.0.1/Browsable/_9_0_76d0249_1109067591791_562382_3151Report.html
    33# Ticket refs #52
    4 module OpenEhr
     4module OpenEHR
    55  module RM
    66    module DataTypes
     
    1010
    1111        class DataValue
    12           include OpenEhr::RM::Support::Definition::BasicDefinition
     12          include OpenEHR::RM::Support::Definition::BasicDefinition
     13          attr_accessor :value
     14          alias :v :value
     15
     16          def initialize(args = {})
     17            self.value = args[:value]
     18          end
     19
    1320          def ==(other)
    1421            return self.value == other.value
     
    1724
    1825        class DvBoolean < DataValue
    19           def initialize(value)
    20             self.value = value
     26          def initialize(args)
     27            super(args)
    2128          end
     29
    2230          def value=(value)
    2331            raise ArgumentError, "value must not be nil" if value.nil?
     
    3543
    3644        class DvState < DataValue
    37           attr_reader :value
     45          attr_reader :is_terminal
    3846
    39           def initialize(value, is_terminal)
    40             self.value=value
    41             self.is_terminal=is_terminal
     47          def initialize(args)           
     48            super(args)
     49            self.is_terminal = args[:is_terminal]
    4250          end
     51
    4352          def value=(v)
    4453            raise ArgumentError, "value should not be nil" if v.nil?
    4554            @value = v
    4655          end
     56
    4757          def is_terminal?
    4858            @is_terminal
    4959          end
     60
    5061          def is_terminal=(s)
    5162            raise ArgumentError, "terminal should not be nil" if s.nil?
     
    5566
    5667        class DvIdentifier
    57           attr_accessor :issuer, :assigner, :id, :type
    58           def initialize(assigner, id, issuer, type)
     68          attr_reader :issuer, :assigner, :id, :type
     69
     70          def initialize(args = {})
    5971            if assigner.nil? or assigner.empty?\
    6072              or id.nil? or id.empty? or issuer.nil? or issuer.empty?\
Note: See TracChangeset for help on using the changeset viewer.