lib/nested_array/nested.rb in nested_array-2.0.1 vs lib/nested_array/nested.rb in nested_array-2.0.2
- old
+ new
@@ -293,10 +293,10 @@
ret = []
last = []
each_nested do |node, parents, level, is_last|
last[level+1] = is_last
node_text = node[options[:option_text]]
- node_level = (1..level).map{|l| last[l] == true ? ' ' : '┃'}.join
+ node_level = (1..level).map{|l| last[l] == true ? ' ' : '┃'}.join
node_last = is_last ? '┗' : '┣'
node_children = node[options[:children]].present? && node[options[:children]].length > 0 ? '┳' : '━'
option_text = "#{node_level}#{node_last}#{node_children}╸#{node_text}"
option_value = node[options[:option_value]]
ret.push [option_text, option_value]