Class: Frigate::Operation::Action::Base Abstract
- Inherits:
-
Object
- Object
- Frigate::Operation::Action::Base
- Defined in:
- lib/frigate/operation/action/base.rb
Overview
Base class is an abstact class
Instance Attribute Summary collapse
-
#action_result ⇒ Object
readonly
Returns the value of attribute action_result.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#model_form ⇒ Object
readonly
Returns the value of attribute model_form.
-
#operation ⇒ Object
readonly
Returns the value of attribute operation.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Class Method Summary collapse
-
.run(operation, params, opts = {}) ⇒ Object
Initializes action class and pass args to instance run method.
Instance Method Summary collapse
-
#action ⇒ Object
You should define an action in here.
-
#initialize(operation, opts = {}) ⇒ Base
constructor
A new instance of Base.
-
#run(params) ⇒ Object
Runs action’s mechanism.
Constructor Details
#initialize(operation, opts = {}) ⇒ Base
Returns a new instance of Base.
21 22 23 24 |
# File 'lib/frigate/operation/action/base.rb', line 21 def initialize(operation, opts={}) @operation = operation @opts = opts end |
Instance Attribute Details
#action_result ⇒ Object (readonly)
Returns the value of attribute action_result.
17 18 19 |
# File 'lib/frigate/operation/action/base.rb', line 17 def action_result @action_result end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
17 18 19 |
# File 'lib/frigate/operation/action/base.rb', line 17 def model @model end |
#model_form ⇒ Object (readonly)
Returns the value of attribute model_form.
17 18 19 |
# File 'lib/frigate/operation/action/base.rb', line 17 def model_form @model_form end |
#operation ⇒ Object (readonly)
Returns the value of attribute operation.
17 18 19 |
# File 'lib/frigate/operation/action/base.rb', line 17 def operation @operation end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
17 18 19 |
# File 'lib/frigate/operation/action/base.rb', line 17 def opts @opts end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
17 18 19 |
# File 'lib/frigate/operation/action/base.rb', line 17 def params @params end |
Class Method Details
.run(operation, params, opts = {}) ⇒ Object
Initializes action class and pass args to instance run method
12 13 14 |
# File 'lib/frigate/operation/action/base.rb', line 12 def run(operation, params, opts={}) new(operation, opts).run(params) end |
Instance Method Details
#action ⇒ Object
You should define an action in here
32 33 34 |
# File 'lib/frigate/operation/action/base.rb', line 32 def action raise NotImplementedError end |
#run(params) ⇒ Object
Runs action’s mechanism
27 28 29 |
# File 'lib/frigate/operation/action/base.rb', line 27 def run(params) (@params = params); action; model_form end |