- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/models/am/archetype/constraint_model/archetype_constraint.rb
r4 r23 4 4 module Archetype 5 5 module Constraint_Model 6 class A rchetype_Constraint6 class ARCHETYPE_CONSTRAINT 7 7 8 end 9 10 class CARDINALITY 11 12 end 13 14 class C_OBJECT < ARCHETYPE_CONSTRAINT 15 attr_accessor :node_id, :occurrences, :rm_type_name 16 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 end 22 end 23 24 class C_ATTRIBUTE < ARCHETYPE_CONSTRAINT 25 attr_accessor :rm_attribute_name, :existence, :children 26 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 end 33 end 34 35 class C_DEFINED_OBJECT < C_OBJECT 36 attr_accessor :assumed_value 37 38 def initialize(args = { }) 39 @assumed_value = args[:assumed_value] if args[:assumed_value] 40 super 41 end 42 end 43 44 class C_PRIMITIVE_OBJECT < C_DEFINED_OBJECT 45 attr_accessor :item 46 47 def initialize(args = { }) 48 @attributes = args[:item] if args[:item] 49 super 50 end 51 end 52 53 class C_COMPLEX_OBJECT < C_DEFINED_OBJECT 54 attr_accessor :attributes, :attributes_valid 55 56 def initialize(args = { }) 57 @attributes = args[:attributes] ? args[:attributes] : [] 58 super 59 end 60 61 def self.create(args = { }, &block) 62 c_complex_object = new(args) 63 if block_given? 64 yield c_complex_object 65 end 66 return c_complex_object 67 end 68 end 69 70 class C_DOMAIN_TYPE < C_DEFINED_OBJECT 71 72 end 73 74 class C_REFERENCE_OBJECT < C_OBJECT 75 76 end 77 78 class ARCHETYPE_INTERNAL_REF < C_REFERENCE_OBJECT 79 80 end 81 82 class ARCHETYPE_SLOT < C_REFERENCE_OBJECT 83 84 end 85 86 class CONSTRAINT_REF < C_REFERENCE_OBJECT 87 88 end 89 90 class C_SINGLE_ATTRIBUTE < C_ATTRIBUTE 91 attr_accessor :alternatives 92 93 def initialize(args = { }) 94 @alternatives = args[:alternatives] ? args[:alternatives] : [] 95 super 96 end 97 end 98 99 class C_MULTIPLE_ATTRIBUTE < C_ATTRIBUTE 100 attr_accessor :members, :cardinality 101 102 def initialize(args = { }) 103 @members = args[:members] ? args[:members] : [] 104 @cardinality = args[:cardinality] if args[:cardinality] 105 super 106 end 8 107 end 9 108 end
Note:
See TracChangeset
for help on using the changeset viewer.