Class: TreeFilter::Leaf
- Inherits:
-
Struct
- Object
- Struct
- TreeFilter::Leaf
- Includes:
- JsonTerminal
- Defined in:
- lib/tree_filter.rb
Overview
Note:
All data structures containing this object must be filtered before
Allows different data structures to be presented dependent on whether it is explicitly selected or not. Usually used to provide a “summary” object by default, and then only include detail if explicitly asked for.
data = {'a' => TreeFilter::Leaf.new('/a', {'id' => 'a'})}
TreeFilter.new("env").filter(data) # => {'env' => '/a'}
TreeFilter.new("env[*]").filter(data) # => {'env' => {'id' => 'a'}}
converting to JSON, otherwise you will get a stack overflow error.
Instance Attribute Summary collapse
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
Method Summary
Methods included from JsonTerminal
Instance Attribute Details
#left ⇒ Object
Returns the value of attribute left
46 47 48 |
# File 'lib/tree_filter.rb', line 46 def left @left end |
#right ⇒ Object
Returns the value of attribute right
46 47 48 |
# File 'lib/tree_filter.rb', line 46 def right @right end |