Class: Eco::API::Common::Loaders::Policy

Inherits:
CaseBase show all
Defined in:
lib/eco/api/common/loaders/policy.rb

Instance Attribute Summary

Attributes included from Language::AuxiliarLogger

#logger

Instance Method Summary collapse

Methods inherited from CaseBase

#name, name_only_once!, original_name

Methods inherited from Base

<=>, created_at, set_created_at!

Methods included from Language::Klass::InheritableClassVars

#inheritable_attrs, #inheritable_class_vars, #inherited

Methods included from Language::Klass::Naming

#instance_variable_name, #to_constant

Methods included from Language::Klass::Hierarchy

#descendants, #descendants?

Methods included from Language::Klass::Builder

#new_class

Methods included from Language::Klass::Uid

#uid

Methods included from Language::Klass::Resolver

#class_resolver, #resolve_class

Methods included from Language::Klass::Const

#if_const, #redef_without_warning

Methods included from Language::AuxiliarLogger

#log

Constructor Details

#initialize(policies) ⇒ Policy

rubocop:disable Lint/MissingSuper



6
7
8
9
10
11
# File 'lib/eco/api/common/loaders/policy.rb', line 6

def initialize(policies) # rubocop:disable Lint/MissingSuper
  msg = "Expected Eco::API::Policies. Given #{policies.class}"
  raise msg unless policies.is_a?(Eco::API::Policies)

  policies.define(name, &method(:main))
end

Instance Method Details

#main(data, session, options, policy, job = nil) ⇒ Object

Parameters:

  • data (Variant)
    • people [Eco::API::Organization::People] the people in the queue of the current job
  • session (Eco::API::Session)

    the current session where the usecase kicks in.

  • options (Hash)

    the options that modify the case behaviour or bring some dependencies.

  • policy (Eco::API::Policies::Policy)

    the policy instance object.

  • job (Eco::API::Session::Batch::Job) (defaults to: nil)

    the Batch::Job that these people belong to the queue thereof.



19
20
21
# File 'lib/eco/api/common/loaders/policy.rb', line 19

def main(data, session, options, policy, job = nil) # rubocop:disable Lint/UnusedMethodArgument
  raise 'You should implement this method'
end