Class: Reactor::Migration
- Inherits:
-
Object
- Object
- Reactor::Migration
- Defined in:
- lib/reactor/migration.rb
Constant Summary collapse
- METHODS =
{ :create_obj => Plans::CreateObj, :delete_obj => Plans::DeleteObj, :update_obj => Plans::UpdateObj, :create_class => Plans::CreateObjClass, :delete_class => Plans::DeleteObjClass, :update_class => Plans::UpdateObjClass, :rename_class => Plans::RenameObjClass, :create_attribute => Plans::CreateAttribute, :delete_attribute => Plans::DeleteAttribute, :update_attribute => Plans::UpdateAttribute, :create_attribute_group => Plans::CreateAttributeGroup, :delete_attribute_group => Plans::DeleteAttributeGroup, :update_attribute_group => Plans::UpdateAttributeGroup, :create_group => Plans::CreateGroup, :delete_group => Plans::DeleteGroup, :update_group => Plans::UpdateGroup, :rename_group => Plans::RenameGroup, :create_channel => Plans::CreateChannel, :delete_channel => Plans::DeleteChannel, :create_job => Plans::CreateJob, :delete_job => Plans::DeleteJob, :update_job => Plans::UpdateJob }
Class Method Summary collapse
- .contained ⇒ Object
- .contains(*args) ⇒ Object
- .method_missing(name, *args, &block) ⇒ Object
- .respond_to?(name) ⇒ Boolean
Class Method Details
.contained ⇒ Object
75 76 77 |
# File 'lib/reactor/migration.rb', line 75 def self.contained @contained || [] end |
.contains(*args) ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/reactor/migration.rb', line 67 def self.contains(*args) @contained ||= [] args.flatten.each do |arg| migration_num = arg.to_i.to_s @contained << migration_num end end |
.method_missing(name, *args, &block) ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/reactor/migration.rb', line 52 def self.method_missing(name, *args, &block) if METHODS.key? name.to_sym then instance = init(name,*args) plan(instance,&block) prepare(instance) migrate(instance) else super(name, *args, &block) end end |
.respond_to?(name) ⇒ Boolean
63 64 65 |
# File 'lib/reactor/migration.rb', line 63 def self.respond_to?(name) METHODS.key?(name.to_sym) || super(name) end |