lib/crossyglot/formats/jpz.rb
# Write xml of this puzzle to given IO object
#
# @param [IO] io
Write xml of this puzzle to given IO object
Write xml of this puzzle to given IO object
def write_io(io)
        update_word_lengths!
        builder = Nokogiri::XML::Builder.new do |xml|
          xml.send('crossword-compiler-applet', xmlns: PRIMARY_NAMESPACE) do
            xml.send('rectangular-puzzle', xmlns: PUZZLE_NAMESPACE) do
              xml.metadata do
                xml.creator author  if author
                xml.title title  if title
                xml.copyright copyright  if copyright
                xml.description description  if description
              end
              xml.crossword do
                xml.grid(height: height, width: width) do
                  write_cells(xml)
                end
                write_words(xml)
                write_clues(xml)
              end
            end
          end
        end
        io.write(builder.to_xml)
      end
def write_io ( io ) update_word_lengths! builder = Nokogiri :: XML :: Builder . new do | xml | xml . send ( 'crossword-compiler-applet' , xmlns : PRIMARY_NAMESPACE ) do xml . send ( 'rectangular-puzzle' , xmlns : PUZZLE_NAMESPACE ) do xml . metadata do xml . creator author if author xml . title title if title xml . copyright copyright if copyright xml . description description if description end xml . crossword do xml . grid ( height : height , width : width ) do write_cells ( xml ) end write_words ( xml ) write_clues ( xml ) end end end end io . write ( builder . to_xml ) end
Write xml of this puzzle to given IO object
Write xml of this puzzle to given IO object
io
None