Class: Array

Inherits:
Object show all
Defined in:
lib/pp-colour/array.rb

Instance Method Summary collapse

Instance Method Details

#pretty_print(q) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/pp-colour/array.rb', line 2

def pretty_print(q)
  q.group(1, '['.green, ']'.green) {
    q.seplist(self) {|v|
      q.pp v
    }
  }
end

#pretty_print_cycle(q) ⇒ Object



10
11
12
# File 'lib/pp-colour/array.rb', line 10

def pretty_print_cycle(q)
  q.text(empty? ? '[]'.green : '[...]'.green)
end