Class: TreeFilter::NullSlice

Inherits:
Object
  • Object
show all
Defined in:
lib/tree_filter.rb

Overview

Indicates no more filtering for the given object, return it as is.

Instance Method Summary collapse

Instance Method Details

#filter(x) ⇒ Object



76
77
78
79
80
81
82
83
84
85
# File 'lib/tree_filter.rb', line 76

def filter(x)
  case x
  when Leaf
    filter(x.left)
  when Defer
    filter(x.call)
  else
    x
  end
end