Class: Rewrite::ByExample::NilEntity

Inherits:
EntityMatcher show all
Defined in:
lib/rewrite/by_example/nil_entity.rb

Overview

Matches nil.

Instance Attribute Summary

Attributes inherited from EntityMatcher

#predicate

Instance Method Summary collapse

Methods inherited from EntityMatcher

#after_unfold, #such_that!

Instance Method Details

#fold(enum_of_bindings) ⇒ Object



14
15
16
# File 'lib/rewrite/by_example/nil_entity.rb', line 14

def fold (enum_of_bindings)
  nil
end

#to_sObject



18
19
20
# File 'lib/rewrite/by_example/nil_entity.rb', line 18

def to_s
  "nil"
end

#unfold(sexp) ⇒ Object



10
11
12
# File 'lib/rewrite/by_example/nil_entity.rb', line 10

def unfold (sexp)
  {} if sexp.nil?
end