It is a rectangular block with 2 electromagnetic coils, one at each end. When one end is energized it pulls the spool to that end allowing fluid to flow in a specific path. When power goes to the opposite coil the spool is pulled to the other end allowing the fluid to take a different path.
The way you will need to tap into the system is to cut the lines feeding the ram you wish to use power from. Feed these to the common connections of the directional valve. Work out which end you wish to hook back to the ram and the other end will go to the aux connection.
You will really need to talk to a hydraulic supply shop for the valve, it should have a diagram of how it is to be plumbed up. You really should get a hydraulic hose shop to fit it up too, as they will have the fittings. You will need to know the flow rate of the pump too, if its too small for the job it will heat up because it will be causing a restriction. It will also cause slower action of the ram.
Talk to a hydraulic shop, they will understand exactly what you wish to do.