Class: C0::Diff::Pattern
- Inherits:
-
Struct
- Object
- Struct
- C0::Diff::Pattern
- Defined in:
- lib/c0/diff.rb
Overview
One record: an anchored pattern. With no substitution it is an assertion.
Instance Attribute Summary collapse
-
#units ⇒ Object
Returns the value of attribute units.
Instance Method Summary collapse
- #assertion? ⇒ Boolean
-
#replacement ⇒ Object
What it will hold: each sub-unit in place of the unit that holds it.
-
#search ⇒ Object
What the file must hold, once: anchors and olds.
Instance Attribute Details
#units ⇒ Object
Returns the value of attribute units
36 37 38 |
# File 'lib/c0/diff.rb', line 36 def units @units end |
Instance Method Details
#assertion? ⇒ Boolean
43 |
# File 'lib/c0/diff.rb', line 43 def assertion? = units.all?(&:anchor?) |
#replacement ⇒ Object
What it will hold: each sub-unit in place of the unit that holds it.
41 |
# File 'lib/c0/diff.rb', line 41 def replacement = units.map { |u| u.new || u.old }.join.b |
#search ⇒ Object
What the file must hold, once: anchors and olds.
38 |
# File 'lib/c0/diff.rb', line 38 def search = units.map(&:old).join.b |