Sha256: a9dc2494ebff3e4adb247052809326f9110dbae2c6da53d083b229f43a7b43bc

Contents?: true

Size: 402 Bytes

Versions: 2

Compression:

Stored size: 402 Bytes

Contents

module Pump
  module Array
    def pump_to_xml(options={})
      encoder = get_pump_encoder(options[:set], :xml)
      return to_xml(options) unless encoder
      encoder.encode(self)
    end

    private

    def get_pump_encoder(set, format)
      return if empty? || !first.class.respond_to?(:pumps)
      first.class.pumps.get(set, format)
    end
  end
end

class ::Array
  include Pump::Array
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pump-0.5.1 lib/pump/array.rb
pump-0.5.0 lib/pump/array.rb