Class: Array

Inherits:
Object show all
Defined in:
lib/icss/serialization/zaml.rb

Instance Method Summary collapse

Instance Method Details

#to_zaml(z = ZAML.new) ⇒ Object



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
# File 'lib/icss/serialization/zaml.rb', line 392

def to_zaml(z=ZAML.new)
  z.first_time_only(self) {
    z.nested {
      if empty?
        z.emit('[]')
      else
        emitted = false
        each{|v| z.no_comment(v){
            emitted = true
            z.nl('- '); v.to_zaml(z)
          } }
        unless emitted then z.nl ; z.emit('[]') ; end
      end
    }
    z.to_s
  }
end