Colocate Traversal classes with classes they traverse

This puts all knowledge of the traversal in the same file, and removes
the need for a CASES registry.
This commit is contained in:
Stephen Paul Weber
2018-10-18 09:37:48 -04:00
parent d789ec4175
commit c11fc656cf
13 changed files with 72 additions and 82 deletions
+9
View File
@@ -128,6 +128,15 @@ module Liquid
end
end
end
class Traversal < Liquid::Traversal
def children
[
@node.left, @node.right,
@node.child_condition, @node.attachment
].compact
end
end
end
class ElseCondition < Condition