Class: Reactor::Plans::CreateObjClass
- Inherits:
-
CommonObjClass
- Object
- CommonObjClass
- Reactor::Plans::CreateObjClass
- Defined in:
- lib/reactor/plans/create_obj_class.rb
Constant Summary
Constants inherited from CommonObjClass
Reactor::Plans::CommonObjClass::ALLOWED_PARAMS
Instance Method Summary collapse
-
#initialize(*args) ⇒ CreateObjClass
constructor
A new instance of CreateObjClass.
- #migrate! ⇒ Object
- #prepare! ⇒ Object
Methods inherited from CommonObjClass
Methods included from Prepared
Constructor Details
#initialize(*args) ⇒ CreateObjClass
Returns a new instance of CreateObjClass.
7 8 9 10 11 12 |
# File 'lib/reactor/plans/create_obj_class.rb', line 7 def initialize(*args) super() (name, type), = separate_arguments(*args) @name = name || [:name] @type = type || [:objType] || [:type] end |
Instance Method Details
#migrate! ⇒ Object
22 23 24 25 26 |
# File 'lib/reactor/plans/create_obj_class.rb', line 22 def migrate! klass = Reactor::Cm::ObjClass.create(@name, @type) migrate_attrs!(klass) migrate_params!(klass) end |
#prepare! ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/reactor/plans/create_obj_class.rb', line 14 def prepare! error("name is nil") if @name.nil? error("type is nil") if @type.nil? error("objClass #{@name} already exists") if Reactor::Cm::ObjClass.exists?(@name) prepare_attrs!(nil) prepare_params!(nil) end |