Class: BloodContracts::Contracts::Matcher
- Inherits:
-
Object
- Object
- BloodContracts::Contracts::Matcher
- Extended by:
- Dry::Initializer
- Defined in:
- lib/blood_contracts/contracts/matcher.rb
Instance Method Summary collapse
Instance Method Details
#call(input, output, meta = Hash.new, storage:) {|rule_names, options| ... } ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/blood_contracts/contracts/matcher.rb', line 8 def call(input, output, = Hash.new, storage:) = Hashie::Mash.new(input: input, output: output, meta: ) rule_names = select_matched_rules!().keys rule_names = [Storage::UNDEFINED_RULE] if rule_names.empty? Array(rule_names).each(&storage.method(:store)) yield rule_names, if block_given? !storage.found_unexpected_behavior? end |