Module: Cleo::ConnectionProcessor

Defined in:
lib/generators/acts_as_cleo/install/templates/jobs/cleo_connection_processor.rb

Class Method Summary collapse

Class Method Details

.perform(operation, klass, klass_id) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/generators/acts_as_cleo/install/templates/jobs/cleo_connection_processor.rb', line 4

def self.perform(operation, klass, klass_id)
  on_me = Kernel.const_get(klass).find(klass_id)

  case operation.downcase
  when "create"
    Cleo::ConnectionServer.execute_create(on_me)
  when "update"
    Cleo::ConnectionServer.execute_update(on_me)
  when "delete"
    Cleo::ConnectionServer.execute_delete(on_me)
  end
end