Class: Cuprum::Rails::Actions::Middleware::Resources::Query

Inherits:
Cuprum::Rails::Action show all
Includes:
Middleware
Defined in:
lib/cuprum/rails/actions/middleware/resources/query.rb

Overview

Abstract middleware for performing a resource query.

Direct Known Subclasses

Find

Instance Attribute Summary collapse

Attributes inherited from Cuprum::Rails::Action

#options

Instance Method Summary collapse

Methods inherited from Cuprum::Rails::Action

#call, #params

Constructor Details

#initialize(**resource_params) ⇒ Query

Returns a new instance of Query.

Parameters:

  • resource_params (Hash)

    parameters to pass to the resource.



14
15
16
17
18
# File 'lib/cuprum/rails/actions/middleware/resources/query.rb', line 14

def initialize(**resource_params)
  super()

  @resource = build_resource(**resource_params)
end

Instance Attribute Details

#resourceCuprum::Collections::Resource (readonly)

Returns the resource.

Returns:

  • (Cuprum::Collections::Resource)

    the resource.



21
22
23
# File 'lib/cuprum/rails/actions/middleware/resources/query.rb', line 21

def resource
  @resource
end