Class: Rewrite::ByExample::LiteralEntity
- Inherits:
-
SexpEntity
- Object
- EntityMatcher
- SexpEntity
- Rewrite::ByExample::LiteralEntity
- Defined in:
- lib/rewrite/by_example/literal_entity.rb
Instance Attribute Summary
Attributes inherited from SexpEntity
Attributes inherited from EntityMatcher
Instance Method Summary collapse
-
#initialize(name = Rewrite.gensym) ⇒ LiteralEntity
constructor
A new instance of LiteralEntity.
Methods inherited from SexpEntity
#fold, for_sequence, proc_capturer, #to_s, #unfold
Methods inherited from EntityMatcher
#after_unfold, #fold, #such_that!, #unfold
Constructor Details
#initialize(name = Rewrite.gensym) ⇒ LiteralEntity
Returns a new instance of LiteralEntity.
13 14 15 16 17 18 19 |
# File 'lib/rewrite/by_example/literal_entity.rb', line 13 def initialize(name = Rewrite.gensym) super() self.sequence = Composition.new( LengthOne.new(ObjectToMatcher.from_object(:lit)), LengthOne.new(Bind.new(name, AnyEntity.new)) ) end |