Sha256: 3af2ab64e84bdb4e11684276ac4915cb0d89758f67fa2992f19ef51fdedbf249
Contents?: true
Size: 1.14 KB
Versions: 9
Compression:
Stored size: 1.14 KB
Contents
# # ActiveFacts Compositions, Metamodel aspect to look for validation errors in a composition # # Quite a few constraints are not enforced during the construction of a composition. # This method does a post-validation to ensure that everything looks ok. # # Copyright (c) 2015 Clifford Heath. Read the LICENSE file. # require "activefacts/metamodel" require "activefacts/metamodel/validate/composition" require "activefacts/compositions/compositor" require "activefacts/generator" module ActiveFacts module Generators class Validate def self.options { } end def initialize composition, options = {} @composition = composition @options = options end def generate &report if !report trace.enable 'composition_validator' report ||= proc do |component, problem| trace :composition_validator, "!!PROBLEM!! #{component.inspect}: #{problem}" debugger if trace :composition_validator_debug component end end @composition.validate(&report) nil end end publish_generator Validate end end
Version data entries
9 entries across 9 versions & 1 rubygems