Class: Cuprum::Rails::Action
- Inherits:
-
Command
- Object
- Command
- Cuprum::Rails::Action
- Extended by:
- Forwardable
- Defined in:
- lib/cuprum/rails/action.rb
Overview
Abstract command that implement a controller action.
Direct Known Subclasses
Cuprum::Rails::Actions::Middleware::Associations::Query, Cuprum::Rails::Actions::Middleware::Resources::Query, Cuprum::Rails::Actions::ResourceAction
Instance Attribute Summary collapse
-
#options ⇒ Hash<Symbol, Object>
readonly
Additional options for the action.
-
#repository ⇒ Cuprum::Collections::Repository
readonly
The repository containing the data collections for the application or scope.
-
#request ⇒ Cuprum::Rails::Request
readonly
The formatted request.
Instance Method Summary collapse
-
#call(request: , repository: nil, **options) ⇒ Cuprum::Result
Performs the controller action.
-
#params ⇒ Hash<String, Object>
The request parameters.
Instance Attribute Details
#options ⇒ Hash<Symbol, Object> (readonly)
Returns additional options for the action.
32 33 34 |
# File 'lib/cuprum/rails/action.rb', line 32 def @options end |
#repository ⇒ Cuprum::Collections::Repository (readonly)
Returns the repository containing the data collections for the application or scope.
36 37 38 |
# File 'lib/cuprum/rails/action.rb', line 36 def repository @repository end |
#request ⇒ Cuprum::Rails::Request (readonly)
Returns the formatted request.
39 40 41 |
# File 'lib/cuprum/rails/action.rb', line 39 def request @request end |
Instance Method Details
#call(request: , repository: nil, **options) ⇒ Cuprum::Result
Performs the controller action.
Subclasses should implement a #process method with the :request keyword, which accepts an ActionDispatch::Request instance.
|
# File 'lib/cuprum/rails/action.rb', line 14
|
#params ⇒ Hash<String, Object>
Returns the request parameters.
29 |
# File 'lib/cuprum/rails/action.rb', line 29 def_delegators :@request, :params |