Changeset 117


Ignore:
Timestamp:
Apr 5, 2009, 7:22:49 PM (13 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #64

Location:
ruby/trunk/lib/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/models/rm/common/change_control.rb

    r115 r117  
    2121          end
    2222          def versions=(versions)
    23             unless uid.nil?
    24               if uid.empty?
     23            unless versions.nil?
     24              if versions.empty?
    2525                raise ArgumentError, 'versions shoud not be nil or empty.'
    2626              end
     
    4040        class Versioned_Object
    4141        end
     42
    4243        class Version
     44          attr_reader :uid, :contribution, :commit_audit, :signature
     45          attr_reader :attestations, :data
     46          def initialize(uid, contribution, commit_audit, signature=nil, attestations=nil, data=nil)
     47            self.uid = uid
     48            self.contribution = contribution         
     49            self.commit_audit = commit_audit
     50          end
     51          def uid=(uid)
     52            raise ArgumentError, "uid should not be nil" if uid.nil?
     53          end
     54          def contribution=(contribution)
     55            raise ArgumentError, "contribution should not be nil" if contribution.nil? or contribution.type == ''
     56            @contribution = contribution
     57          end
     58          def commit_audit=(commit_audit)
     59            raise ArgumentError, "commit_audit should not be nil" if commit_audit.nil?
     60            @commit_audit = commit_audit
     61          end
    4362        end
     63
    4464        class Imported_Version < Version
    4565        end
     66
    4667        class Original_Version < Version
    4768        end
  • ruby/trunk/lib/models/tests/test_reference_model.rb

    r114 r117  
    528528class RM_Common_Change_Control_Test < Test::Unit::TestCase
    529529  def setup
    530     assert_nothing_raised(Exception){@versioned = OpenEHR::Common::Change_Control::versioned.new(
    531   end
    532 end
     530    assert_nothing_raised(Exception){}
     531    assert_nothing_raised(Exception){@version = OpenEHR::RM::Common::Change_Control::Contribution.new()}
     532  end
     533end
Note: See TracChangeset for help on using the changeset viewer.