lib/jumoku/builders/shared.rb
# The terminal nodes of the tree in a 1D array.
#
# @return [Array(node)] only terminal nodes (empty array if no terminal nodes,
#   but should never happen in a tree).
The terminal nodes of the tree in a 1D array.
The terminal nodes of the tree in a 1D array .
def terminal_nodes
      nodes.inject([]) do |terminals, node|
        terminals << node if terminal?(node)
        terminals
      end
    end
def terminal_nodes nodes . inject ( [ ] ) do | terminals , node | terminals << node if terminal? ( node ) terminals end end
The terminal nodes of the tree in a 1D array.
The terminal nodes of the tree in a 1D array .
only terminal nodes (empty array if no terminal nodes, but should never happen in a tree).
only terminal nodes ( empty array if no terminal nodes but should never happen in a tree ) .
Array(node)