Class: Metamorpher::Matcher::Match

Inherits:
Object
  • Object
show all
Extended by:
Attributable
Defined in:
lib/metamorpher/matcher/match.rb

Instance Method Summary collapse

Instance Method Details

#combine(combinee) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/metamorpher/matcher/match.rb', line 17

def combine(combinee)
  if combinee.matches?
    Match.new(root: root, substitution: combinee.substitution.merge(substitution))
  else
    NoMatch.new
  end
end

#match_for(variable) ⇒ Object



13
14
15
# File 'lib/metamorpher/matcher/match.rb', line 13

def match_for(variable)
  substitution[variable.name]
end

#matches?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/metamorpher/matcher/match.rb', line 9

def matches?
  true
end