Class: Operationable::Operation
- Inherits:
-
Object
- Object
- Operationable::Operation
- Defined in:
- lib/operationable.rb,
lib/operationable/operation.rb
Defined Under Namespace
Classes: Builder, Callback, Delayer, Serializer, Specification
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(record, user, params = {}) ⇒ Operation
constructor
A new instance of Operation.
- #process ⇒ Object
Constructor Details
#initialize(record, user, params = {}) ⇒ Operation
Returns a new instance of Operation.
6 7 8 9 10 |
# File 'lib/operationable/operation.rb', line 6 def initialize(record, user, params={}) @record = record @user = user @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/operationable/operation.rb', line 4 def params @params end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
4 5 6 |
# File 'lib/operationable/operation.rb', line 4 def record @record end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
4 5 6 |
# File 'lib/operationable/operation.rb', line 4 def result @result end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'lib/operationable/operation.rb', line 4 def user @user end |
Instance Method Details
#process ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/operationable/operation.rb', line 12 def process return false unless valid @result = build return false unless persist run record.reload end |