Module: TreeFilter::JsonTerminal

Included in:
Defer, Leaf
Defined in:
lib/tree_filter.rb

Instance Method Summary collapse

Instance Method Details

#as_json(*args) ⇒ Object

This breaks the contract of `to_json`, since only terminal classes (hard-coded into activesupport) should return themselves. We need to use `as_json` to expand other classes, however. Data structures containing this object should always be filtered before being converted though, so in practice this shouldn't be an issue.


30
31
32
# File 'lib/tree_filter.rb', line 30

def as_json(*args)
  self
end