Class: Ucasy::Flow
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
_required_attributes, call, #initialize, #perform, required_attributes, validate
Methods inherited from Callable
call
Constructor Details
This class inherits a constructor from Ucasy::Base
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Ucasy::Base
Class Method Details
.flow(*ucases) ⇒ Object
4
5
6
|
# File 'lib/ucasy/flow.rb', line 4
def flow(*ucases)
@ucases = ucases
end
|
.transactional ⇒ Object
12
13
14
|
# File 'lib/ucasy/flow.rb', line 12
def transactional
@transactional = true
end
|
.transactional? ⇒ Boolean
16
17
18
|
# File 'lib/ucasy/flow.rb', line 16
def transactional?
@transactional || false
end
|
.ucases ⇒ Object
8
9
10
|
# File 'lib/ucasy/flow.rb', line 8
def ucases
@ucases || []
end
|
Instance Method Details
#call ⇒ Object
21
22
23
24
25
26
27
28
29
|
# File 'lib/ucasy/flow.rb', line 21
def call
if self.class.transactional?
ActiveRecord::Base.transaction { execute }
else
execute
end
self
end
|