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-2.3.0 lib/unitwise/standard/extras.rb
unitwise-2.2.0 lib/unitwise/standard/extras.rb
unitwise-2.1.0 lib/unitwise/standard/extras.rb
unitwise-2.0.0 lib/unitwise/standard/extras.rb
unitwise-1.1.0 lib/unitwise/standard/extras.rb
unitwise-193-1.0.4 lib/unitwise/standard/extras.rb
unitwise-1.0.4 lib/unitwise/standard/extras.rb
unitwise-1.0.3 lib/unitwise/standard/extras.rb
unitwise-1.0.2 lib/unitwise/standard/extras.rb
unitwise-1.0.1 lib/unitwise/standard/extras.rb
unitwise-1.0.0 lib/unitwise/standard/extras.rb
unitwise-0.10.0 lib/unitwise/standard/extras.rb
unitwise-0.9.1 lib/unitwise/standard/extras.rb
unitwise-0.9.0 lib/unitwise/standard/extras.rb
unitwise-0.8.1 lib/unitwise/standard/extras.rb
unitwise-0.8.0 lib/unitwise/standard/extras.rb
unitwise-0.7.1 lib/unitwise/standard/extras.rb
unitwise-0.7.0 lib/unitwise/standard/extras.rb
unitwise-0.6.2 lib/unitwise/standard/extras.rb
unitwise-0.6.1 lib/unitwise/standard/extras.rb