Class: Cuprum::Rails::Actions::Middleware::Resources::Find

Inherits:
Query show all
Defined in:
lib/cuprum/rails/actions/middleware/resources/find.rb

Overview

Middleware for querying a resource.

Instance Attribute Summary

Attributes inherited from Query

#resource

Attributes inherited from Cuprum::Rails::Action

#options, #repository, #request

Instance Method Summary collapse

Methods inherited from Cuprum::Rails::Action

#call, #params

Constructor Details

#initialize(only_form_actions: false, **resource_params) ⇒ Find

Returns a new instance of Find.

Parameters:

  • only_form_actions (Boolean) (defaults to: false)

    if true, does not query the resource for non-GET success results. Defaults to false.

  • resource_params (Hash)

    parameters to pass to the resource.



12
13
14
15
16
# File 'lib/cuprum/rails/actions/middleware/resources/find.rb', line 12

def initialize(only_form_actions: false, **resource_params)
  super(**resource_params)

  @only_form_actions = !!only_form_actions
end

Instance Method Details

#only_form_actions?Boolean

Returns if true, does not query the resource for non-GET success results.

Returns:

  • (Boolean)

    if true, does not query the resource for non-GET success results.



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

def only_form_actions?
  @only_form_actions
end