182: def initialize(type, title = nil, attributes = {})
183: @parameters = {}
184:
185:
186: attributes.each do |attr, value|
187: next if attr == :parameters
188: send(attr.to_s + "=", value)
189: end
190:
191: @type, @title = extract_type_and_title(type, title)
192:
193: @type = munge_type_name(@type)
194:
195: if @type == "Class"
196: @title = :main if @title == ""
197: @title = munge_type_name(@title)
198: end
199:
200: if params = attributes[:parameters]
201: extract_parameters(params)
202: end
203:
204: tag(self.type)
205: tag(self.title) if valid_tag?(self.title)
206:
207: @reference = Reference.new(@type,@title)
208: if strict? and ! resource_type
209: if @type == 'Class'
210: raise ArgumentError, "Could not find declared class #{title}"
211: else
212: raise ArgumentError, "Invalid resource type #{type}"
213: end
214: end
215: end