module Spacelift::Policy

Policy is the module that hosts all the other resources in this library, and provides helper methods to deal with the Collection singleton.

Constants

VERSION

Public Instance Methods

define() { |instance| ... } click to toggle source
# File lib/spacelift/policy/policy.rb, line 11
def define
  yield Collection.instance
end
enforce(source) click to toggle source
# File lib/spacelift/policy/policy.rb, line 15
def enforce(source)
  input = JSON.parse(source, object_class: OpenStruct)

  changes = input.resource_changes
  changes ? Collection.instance.process(changes) : []
end