Sha256: 11c836b33b978b76abb425bd1a28c68a7993e22bdaeaa02d2e0c93fbf9283cfa
Contents?: true
Size: 485 Bytes
Versions: 9
Compression:
Stored size: 485 Bytes
Contents
require "attributable" module Metamorpher module Matcher class Match extend Attributable attributes :root, substitution: {} def matches? true end def match_for(variable) substitution[variable.name] end def combine(combinee) if combinee.matches? Match.new(root: root, substitution: combinee.substitution.merge(substitution)) else NoMatch.new end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems