Class: RGen::Util::AutoCreatedClass

Inherits:
Base
  • Object
show all
Defined in:
lib/rgen/util/auto_class_creator.rb

Constant Summary

Constants included from MetamodelBuilder

MetamodelBuilder::ConstantOrderHelper

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from MetamodelBuilder

MMMultiple

Constructor Details

This class inherits a constructor from RGen::Util::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/rgen/util/auto_class_creator.rb', line 18

def method_missing(m,*args)
	return super unless self.class.parent.accEnabled
	if m.to_s =~ /(.*)=$/ 
		self.class.has_one($1)
		send(m,args[0])
	elsif args.size == 0
		self.class.has_many(m)
		send(m)
	end
end