Module: Tasker::Authorization::ResourceConstants::RESOURCES

Defined in:
lib/tasker/authorization/resource_constants.rb

Overview

Resource name constants

Constant Summary collapse

TASK =
'tasker.task'
WORKFLOW_STEP =
'tasker.workflow_step'
HEALTH_STATUS =
'tasker.health_status'
HANDLER =
'tasker.handler'
METRICS =
'tasker.metrics'
ANALYTICS =
'tasker.analytics'

Class Method Summary collapse

Class Method Details

.allArray<String>

Get all resource constants as an array

Returns:

  • (Array<String>)

    All defined resource names



27
28
29
# File 'lib/tasker/authorization/resource_constants.rb', line 27

def self.all
  [TASK, WORKFLOW_STEP, HEALTH_STATUS, HANDLER, METRICS, ANALYTICS]
end

.include?(resource) ⇒ Boolean

Check if a resource constant is defined

Parameters:

  • resource (String)

    Resource name to check

Returns:

  • (Boolean)

    True if the resource is defined



35
36
37
# File 'lib/tasker/authorization/resource_constants.rb', line 35

def self.include?(resource)
  all.include?(resource)
end