Changeset 112


Ignore:
Timestamp:
Oct 26, 2008, 5:14:15 PM (10 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #63, #65

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

Legend:

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

    r110 r112  
    5757
    5858          def name=(name)
    59             raise ArgumentError, 'name should not be empty' if name.nil? or name.empty?
     59            raise ArgumentError, 'name should not be empty' if name.nil? or name.value.empty?
    6060            @name = name
    6161          end
    6262          def links=(links)
    63             raise ArgumentError, "links shoud not be nil" if links.nil?
     63            raise ArgumentError, "links shoud not be empty" if !links.nil? and links.empty?
    6464            @links = links
    6565          end
  • ruby/trunk/lib/models/rm/common/directory.rb

    r111 r112  
    66    module Common
    77      module Directory
    8         class Folder < OpenEHR::RM::Archetyped::Locatable
     8        class Folder < OpenEHR::RM::Common::Archetyped::Locatable
    99          attr_accessor :items
    10           attr_reader folders
     10          attr_reader :folders
     11
    1112          def initialize(archetype_node_id, name, links, parent=nil, folders=nil, items=nil, uid = nil, archetype_details=nil, feeder_audit=nil)
    1213            super(archetype_node_id, name, links, parent, uid, archetype_details, feeder_audit)
    13             self.items = items
     14            self.folders = folders
    1415          end
     16
    1517          def folders=(folders)
    16             raise ArgumentError, "empty subfolder" if !@folders.nil and @folders.empty?
     18            raise ArgumentError, "empty subfolder" if !folders.nil? and folders.empty?
    1719            @folders = folders
    1820          end
  • ruby/trunk/lib/models/tests/test_reference_model.rb

    r110 r112  
    513513  def setup
    514514    dv_text = OpenEHR::RM::Data_Types::Text::DV_Text.new('root')
    515     assert_nothing_raised(Exception){@folder = OpenEHR::RM::Common::Directory::Folder.new('at0000', dv_text)}
     515    assert_nothing_raised(Exception){@folder = OpenEHR::RM::Common::Directory::Folder.new('at0000', dv_text, nil)}
    516516  end
    517517 
     
    521521
    522522  def test_folder
    523     assert_equal 'root', @folder.archetype_node_id
    524     assert_equal 'name', @folder.name.value
     523    assert_equal 'at0000', @folder.archetype_node_id
     524    assert_equal 'root', @folder.name.value
    525525  end
    526526end 
Note: See TracChangeset for help on using the changeset viewer.