Changeset 376 for ruby


Ignore:
Timestamp:
Dec 20, 2009, 6:46:26 PM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #72

Location:
ruby/trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/open_ehr/am/archetype/constraint_model.rb

    r375 r376  
    223223
    224224        class CSingleAttribute < CAttribute
    225           attr_accessor :alternatives
    226 
    227           def initialize(args = { })
    228             @alternatives = args[:alternatives] ? args[:alternatives] : []
    229             super
     225          attr_reader :alternatives
     226
     227          def initialize(args = { })
     228            super
     229            self.alternatives = args[:alternatives]
     230          end
     231
     232          def alternatives=(alternatives)
     233            if alternatives.nil?
     234              raise ArgumentError, 'alternatives are mandatory'
     235            end
     236            @alternatives = alternatives
    230237          end
    231238        end
Note: See TracChangeset for help on using the changeset viewer.