Module: RapidApi::ActionController::Scope::ClassMethods

Defined in:
lib/rapid_api/action_controller/scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#scope_by_procObject

Returns the value of attribute scope_by_proc.



27
28
29
# File 'lib/rapid_api/action_controller/scope.rb', line 27

def scope_by_proc
  @scope_by_proc
end

#scope_paramsObject

Returns the value of attribute scope_params.



27
28
29
# File 'lib/rapid_api/action_controller/scope.rb', line 27

def scope_params
  @scope_params
end

Instance Method Details

#scope_by(*params, &block) ⇒ Object



33
34
35
36
37
# File 'lib/rapid_api/action_controller/scope.rb', line 33

def scope_by(*params, &block)
  define_method :_scope_array, &block
  before_action(:define_scope)
  [*params].each { |p| self.scope_params << p }
end