Sha256: 1c08d95408f3b5e3eba579edea136d0696ccf21de57fadd3378c8bf5cf4e156b
Contents?: true
Size: 906 Bytes
Versions: 10
Compression:
Stored size: 906 Bytes
Contents
module LibBEL module NodeTest def any?(predicates) predicates.each do |predicate| if predicate.call(self) return true end end return false end def any_in_tree?(predicates) predicates.each do |predicate| self.traversal_method(self, :depth_first).call do |ast_node| if predicate.call(ast_node) return true end end end return false end def all?(predicates) predicates.each do |predicate| if !predicate.call(self) return false end end return true end def all_in_tree?(predicates) predicates.each do |predicate| self.traversal_method(self, :depth_first).call do |ast_node| if !predicate.call(ast_node) return false end end end return true end end end
Version data entries
10 entries across 10 versions & 1 rubygems