class Raabro::Tree
def to_a(opts={})
def to_a(opts={}) opts = Array(opts).inject({}) { |h, e| h[e] = true; h } \ unless opts.is_a?(Hash) cn = if opts[:leaves] && (@result == 1) && @children.empty? string elsif opts[:children] != false @children.collect { |e| e.to_a(opts) } else @children.length end [ @name, @result, @offset, @length, @note, @parter, cn ] end