Module: NRSER::Ext::Tree
Overview
Instance methods that are refined in to the Ruby built-ins that we consider trees: Array, Hash and OpenStruct.
Instance Method Summary collapse
-
#each_branch(&block) ⇒ Object
Sends ‘self` and the optional `block` to NRSER.each_branch.
-
#leaves ⇒ Object
Sends ‘self` to NRSER.leaves.
-
#map_branches(&block) ⇒ Object
Calls NRSER.map_branches on ‘self` with `&block`.
-
#map_leaves(&block) ⇒ Object
Calls NRSER.map_leaves on ‘self` with `&block`.
-
#map_tree(**options, &block) ⇒ Object
Calls NRSER.map_tree on ‘self` with `&block`.
Instance Method Details
#each_branch(&block) ⇒ Object
Sends ‘self` and the optional `block` to NRSER.each_branch.
24 25 26 |
# File 'lib/nrser/ext/tree.rb', line 24 def each_branch &block NRSER.each_branch self, &block end |
#leaves ⇒ Object
Sends ‘self` to NRSER.leaves.
10 11 12 |
# File 'lib/nrser/ext/tree.rb', line 10 def leaves NRSER.leaves self end |
#map_branches(&block) ⇒ Object
Calls NRSER.map_branches on ‘self` with `&block`.
31 32 33 |
# File 'lib/nrser/ext/tree.rb', line 31 def map_branches &block NRSER.map_branches self, &block end |
#map_leaves(&block) ⇒ Object
Calls NRSER.map_leaves on ‘self` with `&block`.
17 18 19 |
# File 'lib/nrser/ext/tree.rb', line 17 def map_leaves &block NRSER.map_leaves self, &block end |
#map_tree(**options, &block) ⇒ Object
Calls NRSER.map_tree on ‘self` with `&block`.
38 39 40 |
# File 'lib/nrser/ext/tree.rb', line 38 def map_tree **, &block NRSER.map_tree self, **, &block end |