- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/models/am/archetype/constraint_model/archetype_constraint.rb
r23 r4 4 4 module Archetype 5 5 module Constraint_Model 6 class A RCHETYPE_CONSTRAINT6 class Archetype_Constraint 7 7 8 end9 10 class CARDINALITY11 12 end13 14 class C_OBJECT < ARCHETYPE_CONSTRAINT15 attr_accessor :node_id, :occurrences, :rm_type_name16 17 def initialize(args = { })18 @node_id = args[:node_id] if args[:node_id]19 @occurrences = args[:occurrences] if args[:occurrences]20 @rm_type_name = args[:rm_type_name] if args[:rm_type_name]21 end22 end23 24 class C_ATTRIBUTE < ARCHETYPE_CONSTRAINT25 attr_accessor :rm_attribute_name, :existence, :children26 27 def initialize(args = { })28 @rm_attribute_name = args[:rm_attribute_name] if args[:rm_attribute_name]29 @existence = args[:existence] if args[:existence]30 @children = args[:children] ? args[:children] : []31 32 end33 end34 35 class C_DEFINED_OBJECT < C_OBJECT36 attr_accessor :assumed_value37 38 def initialize(args = { })39 @assumed_value = args[:assumed_value] if args[:assumed_value]40 super41 end42 end43 44 class C_PRIMITIVE_OBJECT < C_DEFINED_OBJECT45 attr_accessor :item46 47 def initialize(args = { })48 @attributes = args[:item] if args[:item]49 super50 end51 end52 53 class C_COMPLEX_OBJECT < C_DEFINED_OBJECT54 attr_accessor :attributes, :attributes_valid55 56 def initialize(args = { })57 @attributes = args[:attributes] ? args[:attributes] : []58 super59 end60 61 def self.create(args = { }, &block)62 c_complex_object = new(args)63 if block_given?64 yield c_complex_object65 end66 return c_complex_object67 end68 end69 70 class C_DOMAIN_TYPE < C_DEFINED_OBJECT71 72 end73 74 class C_REFERENCE_OBJECT < C_OBJECT75 76 end77 78 class ARCHETYPE_INTERNAL_REF < C_REFERENCE_OBJECT79 80 end81 82 class ARCHETYPE_SLOT < C_REFERENCE_OBJECT83 84 end85 86 class CONSTRAINT_REF < C_REFERENCE_OBJECT87 88 end89 90 class C_SINGLE_ATTRIBUTE < C_ATTRIBUTE91 attr_accessor :alternatives92 93 def initialize(args = { })94 @alternatives = args[:alternatives] ? args[:alternatives] : []95 super96 end97 end98 99 class C_MULTIPLE_ATTRIBUTE < C_ATTRIBUTE100 attr_accessor :members, :cardinality101 102 def initialize(args = { })103 @members = args[:members] ? args[:members] : []104 @cardinality = args[:cardinality] if args[:cardinality]105 super106 end107 8 end 108 9 end
Note:
See TracChangeset
for help on using the changeset viewer.