- Timestamp:
- May 6, 2008, 12:18:06 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ruby/trunk/models/am/archetype/constraint_model/archetype_constraint.rb
r23 r32 19 19 @occurrences = args[:occurrences] if args[:occurrences] 20 20 @rm_type_name = args[:rm_type_name] if args[:rm_type_name] 21 end 22 23 def self.create(args = { }, &block) 24 c_object = new(args) 25 if block_given? 26 yield c_object 27 end 28 return c_object 21 29 end 22 30 end … … 44 52 class C_PRIMITIVE_OBJECT < C_DEFINED_OBJECT 45 53 attr_accessor :item 46 54 47 55 def initialize(args = { }) 48 56 @attributes = args[:item] if args[:item] … … 53 61 class C_COMPLEX_OBJECT < C_DEFINED_OBJECT 54 62 attr_accessor :attributes, :attributes_valid 55 63 56 64 def initialize(args = { }) 57 65 @attributes = args[:attributes] ? args[:attributes] : [] … … 73 81 74 82 class C_REFERENCE_OBJECT < C_OBJECT 75 76 83 end 77 84 78 85 class ARCHETYPE_INTERNAL_REF < C_REFERENCE_OBJECT 79 86 attr_accessor :target_path 80 87 end 81 88 82 89 class ARCHETYPE_SLOT < C_REFERENCE_OBJECT 83 90 attr_accessor :includes, :excludes 91 92 def self.create(args = { }, &block) 93 archetype_slot = new(args) 94 archetype_slot.includes = args[:includes] 95 archetype_slot.excludes = args[:excludes] 96 if block_given? 97 yield archetype_slot 98 end 99 return archetype_slot 100 end 84 101 end 85 102 86 103 class CONSTRAINT_REF < C_REFERENCE_OBJECT 87 104 attr_accessor :reference 105 106 def self.create(args = { }, &block) 107 constraint_ref = new(args) 108 constraint_ref.reference = args[:reference] 109 if block_given? 110 yield constraint_ref 111 end 112 return constraint_ref 113 end 88 114 end 89 115
Note:
See TracChangeset
for help on using the changeset viewer.