Module: Comandor::ClassMethods

Defined in:
lib/comandor.rb

Overview

ClassName.perform

Instance Method Summary collapse

Instance Method Details

#perform(*args, &block) ⇒ Object



17
18
19
# File 'lib/comandor.rb', line 17

def perform(*args, &block)
  new.perform(*args, &block)
end

#transaction!(name) ⇒ Object

Add transaction layer

Parameters:

  • [String] (name)

    ActiveRecord::Base.transaction



23
24
25
# File 'lib/comandor.rb', line 23

def transaction!(name)
  class_eval { @transaction_klass, @transaction_method = name.split('.') }
end

#transaction_klassObject

Class variables accessor



28
29
30
# File 'lib/comandor.rb', line 28

def transaction_klass
  @transaction_klass
end

#transaction_methodObject



32
33
34
# File 'lib/comandor.rb', line 32

def transaction_method
  @transaction_method
end