class Asciidoctor::Block
def splain(parent_level = 0)
def splain(parent_level = 0) parent_level += 1 Asciidoctor.puts_indented(parent_level, "Block id: #{id}") unless self.id.nil? Asciidoctor.puts_indented(parent_level, "Block title: #{title}") unless self.title.nil? Asciidoctor.puts_indented(parent_level, "Block caption: #{caption}") unless self.caption.nil? Asciidoctor.puts_indented(parent_level, "Block level: #{level}") unless self.level.nil? Asciidoctor.puts_indented(parent_level, "Block context: #{context}") unless self.context.nil? Asciidoctor.puts_indented(parent_level, "Blocks: #{@blocks.count}") if buffer.is_a? Enumerable buffer.each_with_index do |buf, i| Asciidoctor.puts_indented(parent_level, "v" * (60 - parent_level*2)) Asciidoctor.puts_indented(parent_level, "Buffer ##{i} is a #{buf.class}") Asciidoctor.puts_indented(parent_level, "Name is #{buf.title rescue 'n/a'}") if buf.respond_to? :splain buf.splain(parent_level) else Asciidoctor.puts_indented(parent_level, "Buffer: #{buf}") end Asciidoctor.puts_indented(parent_level, "^" * (60 - parent_level*2)) end else if buffer.respond_to? :splain buffer.splain(parent_level) else Asciidoctor.puts_indented(parent_level, "Buffer: #{@buffer}") end end @blocks.each_with_index do |block, i| Asciidoctor.puts_indented(parent_level, "v" * (60 - parent_level*2)) Asciidoctor.puts_indented(parent_level, "Block ##{i} is a #{block.class}") Asciidoctor.puts_indented(parent_level, "Name is #{block.title rescue 'n/a'}") block.splain(parent_level) if block.respond_to? :splain Asciidoctor.puts_indented(parent_level, "^" * (60 - parent_level*2)) end nil end