Sha256: 152a75b5276dac028f2e1617309741a182f437e35515df2bbf757083422756ee
Contents?: true
Size: 508 Bytes
Versions: 20
Compression:
Stored size: 508 Bytes
Contents
module CSL module PrettyPrinter def tags raise 'not implemened by base class' end def to_xml tags.flatten.join end def pretty_print preamble << tags.map { |t| pp t }.join("\n") end private def tabwidth 2 end def preamble '' end def pp(tag, level = 0) if tag.is_a?(Array) tag.map { |t| pp t, level + 1 }.join("\n") else (' ' * (level * tabwidth)) << tag.to_s end end end end
Version data entries
20 entries across 20 versions & 1 rubygems