Class: Tree::Pairs
- Inherits:
-
Enumerator
- Object
- Enumerator
- Tree::Pairs
- Defined in:
- lib/modular_tree/pairs.rb
Instance Method Summary collapse
-
#fold ⇒ Object
Turn into a nested array tree.
- #group ⇒ Object
- #to_h ⇒ Object
Instance Method Details
#fold ⇒ Object
Turn into a nested array tree
10 |
# File 'lib/modular_tree/pairs.rb', line 10 def fold = abstract_method |
#group ⇒ Object
3 4 5 6 7 |
# File 'lib/modular_tree/pairs.rb', line 3 def group h = {} each { |first, last| (h[first] ||= []) << last } h.each end |
#to_h ⇒ Object
12 |
# File 'lib/modular_tree/pairs.rb', line 12 def to_h = abstract_method |