source: ruby/trunk/models/rm/common/resource.rb@ 24

Last change on this file since 24 was 24, checked in by Tatsukawa, Akimichi, 16 years ago

working on AM::Archetype::ARCHETYPE

File size: 1.8 KB
RevLine 
[4]1require 'set'
2module OpenEHR
3 module RM
4 module Common
5 module Resource
[24]6 class AUTHORED_RESOURCE
7 attr_reader :is_controled,:revision_history, :translations
[4]8 attr_accessor :description, :original_language
[24]9
10 def initialize(args = { })
11 @original_language = args[:original_language] if args[:original_language]
12 @translations = args[:translations] if args[:translations]
13 @revision_history = args[:revision_history] ? args[:revision_history] : nil
14
15 unless @revision_history
16 @is_controled = false
[4]17 else
[24]18 @is_controled = true
[4]19 end
[24]20
21 @original_language = args[:original_language] if args[:original_language]
22 @translations = args[:translations] if args[:translations]
23 @description = args[:description] if args[:description]
[4]24 end
[24]25
[4]26 def current_version
27 @revision_history.most_recent_revision
28 end
[24]29
[4]30 def language_available
31 languages = Set.new
[24]32 if @translations != nil
33 languages << @translations.keys
[4]34 end
[24]35 languages << @original_language.code_string
[4]36 end
37 end
[24]38
39 class TRANSLATION_DETAILS
[4]40 attr_accessor :language, :author, :accreditation
41 attr_accessor :other_details, :terminology_service
[24]42
[4]43 def initialize(language, author, accreditation, other_details,
44 terminology_service)
45 @language = language
46 @author = author
47 @accreditation = accreditation
48 @other_details = other_details
49 @terminology_service = terminology_service
50 end
51 end
52 end
53 end # end of module Common
54 end # end of module RM
55end # end of module OpenEHR
Note: See TracBrowser for help on using the repository browser.