Sha256: 63a38c973f4ba5ec3f7db6fdb12072136a5c08de725d251d651c17bde6c827c6
Contents?: true
Size: 1.13 KB
Versions: 136
Compression:
Stored size: 1.13 KB
Contents
module Eco module API # @todo the autoloading happens on `add`, and there could be multiple pending children to load. # This could translate into the policies not being loaded in order class Policies < Eco::API::UseCases autoloads_children_of "Eco::API::Common::Loaders::Policy" autoload_namespace_ignore "Eco::API" attr_reader :policies def define(name, type: :transform, &block) Eco::API::Policies::Policy.new(name, type: type, root: self, &block).tap do |policy| add(policy) end end def add(policy) raise "Expected Eco::API::Policies::Policy object. Given: #{policy}" unless policy.is_a?(Eco::API::Policies::Policy) super(policy) end def launch(people:, session:, job:, options: {}) args = { people: people, session: session, job: job, options: options } items.map do |policy| policy.launch(**args) end end end end end require_relative 'policies/policy' require_relative 'policies/default_policies'
Version data entries
136 entries across 136 versions & 1 rubygems