Sha256: b49c08f2cb3ed5f7126812caf758b9e93a947f2e3958823644d3bff026455130

Contents?: true

Size: 767 Bytes

Versions: 1

Compression:

Stored size: 767 Bytes

Contents

module Saxon
  module XDM
    def self.Item(item)
      case item
      when Value, AtomicValue, Node, Array, Map, ExternalObject
        item
      when Saxon::S9API::XdmNode
        Node.new(item)
      when Saxon::S9API::XdmAtomicValue
        AtomicValue.new(item)
      when Saxon::S9API::XdmExternalObject
        ExternalObject.new(item)
      when Saxon::S9API::XdmArray
        Array.new(item)
      when Saxon::S9API::XdmMap
        Map.new(item)
      when Saxon::S9API::XdmValue
        Value.new(item)
      when ::Array
        Array.create(item)
      when ::Hash
        Map.create(item)
      else
        if item.respond_to?(:each)
          Array.create(item)
        else
          AtomicValue.create(item)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
saxon-rb-0.4.0-java lib/saxon/xdm/item.rb