Sha256: aff121887ce7478fec19f4a1a451ecf1f1dc46c4c9474a06d30ccc24d47e521e
Contents?: true
Size: 791 Bytes
Versions: 33
Compression:
Stored size: 791 Bytes
Contents
module Eco module API class Policies < Eco::API::UseCases attr_reader :policies def add(policy) raise "Expected Eco::API::Policies::Policy object. Given: #{policy}" unless policy.is_a?(Eco::API::Policies::Policy) super(policy) end 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 launch(people:, session:, options: {}) args = { people: people, session: session, options: options } items.map do |policy| policy.launch(**args) end end end end end require_relative 'policies/policy'
Version data entries
33 entries across 33 versions & 1 rubygems