A quantum system can behave as a wave or as a particle, depending on the experimental arrangement. When, for example, measuring a photon using a Mach-Zehnder interferometer, the photon acts as a wave if the second beam splitter is inserted, but as a particle if this beam splitter is omitted. The decision of whether or not to insert this beam splitter can be made after the photon has entered the interferometer, as in Wheeler's famous delayed-choice thought experiment. In recent quantum versions of this experiment, this decision is controlled by a quantum ancilla, while the beam splitter is itself still a classical object. Here, we propose and realize a variant of the quantum delayed-choice experiment. We configure a superconducting quantum circuit as a Ramsey interferometer, where the element that acts as the first beam splitter can be put in a quantum superposition of its active and inactive states, as verified by the negative values of its Wigner function. We show that this enables the wave and particle aspects of the system to be observed with a single setup, without involving an ancilla that is not itself a part of the interferometer. We also study the transition of this quantum beam splitter from a quantum to a classical object due to decoherence, as observed by monitoring the interferometer output.