class EraXML::EraEmitterDetail::EraEmitter

Public Class Methods

new(out) click to toggle source
# File lib/thinp_xml/era/emit.rb, line 9
def initialize(out)
  @e = ThinpXML::Base::Emitter.new(out)
end

Public Instance Methods

emit_era_array(ea) click to toggle source
# File lib/thinp_xml/era/emit.rb, line 29
def emit_era_array(ea)
  block = lambda do
    ea.each_index do |b|
      @e.emit_line("<era block=\"#{b}\" era=\"#{ea[b]}\"/>")
    end
  end

  @e.emit_tag(ea, 'era_array', &block)
end
emit_superblock(sb, &block) click to toggle source
# File lib/thinp_xml/era/emit.rb, line 13
def emit_superblock(sb, &block)
  @e.emit_tag(sb, 'superblock', :uuid, :block_size, :nr_blocks, :current_era, &block)
end
emit_writesets(sets) click to toggle source
# File lib/thinp_xml/era/emit.rb, line 17
def emit_writesets(sets)
  sets.each do |ws|
    block = lambda do
      ws.bits.each do |b|
        @e.emit_tag(b, :bit, :block, :value)
      end
    end

    @e.emit_tag(ws, 'writeset', :era, :nr_bits, &block)
  end
end