Class: Array

Inherits:
Object show all
Defined in:
lib/json_cat/ext/array.rb

Instance Method Summary collapse

Instance Method Details

#rainbow_print(level = 0) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/json_cat/ext/array.rb', line 4

def rainbow_print(level=0)
  indent = ' ' * (level * 2)
  if length == 0
    return "#{indent}#{Rainbow('[]').color(JsonCat::COLORS[level])}"
  end

  rainbow_print_build(level)
end