Sha256: 113179845b81bb15c787aff8b1e3bf2d3ce30ab7c68c5577d86f8f1242409457

Contents?: true

Size: 369 Bytes

Versions: 31

Compression:

Stored size: 369 Bytes

Contents

module Unitwise::Standard
  module Extras
    def hash_to_markup(hash)
      hash.map do |k,v|
        if v.respond_to?(:to_xml)
          "<#{k}>#{v.to_xml}</#{k}>"
        elsif v.respond_to?(:map)
          v.map do |i|
            "<#{k}>#{i}</#{k}>"
          end.join('')
        else
          "<#{k}>#{v}</#{k}>"
        end
      end.join('')
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
unitwise-0.6.0 lib/unitwise/standard/extras.rb
unitwise-0.5.1 lib/unitwise/standard/extras.rb
unitwise-0.5.0 lib/unitwise/standard/extras.rb
unitwise-0.4.0 lib/unitwise/standard/extras.rb
unitwise-0.3.2 lib/unitwise/standard/extras.rb
unitwise-0.3.1 lib/unitwise/standard/extras.rb
unitwise-0.3.0 lib/unitwise/standard/extras.rb
unitwise-0.2.2 lib/unitwise/standard/extras.rb
unitwise-0.2.1 lib/unitwise/standard/extras.rb
unitwise-0.2.0 lib/unitwise/standard/extras.rb
unitwise-0.1.0 lib/unitwise/standard/extras.rb