Class: Reactor::Plans::CreateAttribute
- Inherits:
-
CommonAttribute
- Object
- CommonAttribute
- Reactor::Plans::CreateAttribute
- Defined in:
- lib/reactor/plans/create_attribute.rb
Constant Summary
Constants inherited from CommonAttribute
Reactor::Plans::CommonAttribute::ALLOWED_PARAMS
Instance Method Summary collapse
-
#initialize(*args) ⇒ CreateAttribute
constructor
A new instance of CreateAttribute.
- #migrate! ⇒ Object
- #prepare! ⇒ Object
Methods inherited from CommonAttribute
Methods included from Prepared
Constructor Details
#initialize(*args) ⇒ CreateAttribute
Returns a new instance of CreateAttribute.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/reactor/plans/create_attribute.rb', line 7 def initialize(*args) super() (name, type), = separate_arguments(*args) @name = name || [:name] @type = type || [:type] # Default values for attributes: # isSearchableInCM: false # isSearchableInTE: false set(:isSearchableInCM, 0) set(:isSearchableInTE, 0) end |
Instance Method Details
#migrate! ⇒ Object
26 27 28 29 |
# File 'lib/reactor/plans/create_attribute.rb', line 26 def migrate! attrib = Reactor::Cm::Attribute.create(@name, @type) migrate_params!(attrib) end |
#prepare! ⇒ Object
19 20 21 22 23 24 |
# File 'lib/reactor/plans/create_attribute.rb', line 19 def prepare! error("name ist nil") if @name.nil? error("type is nil") if @type.nil? # TODO: Type check prepare_params!(nil) end |