P4/Ruby is designed to work in a Ruby-like way as far as possible. It has support for Ruby exceptions to make error handling as easy as possible and smooths out a few of the rough edges in Perforce's error reporting to make it even easier.
P4 is the main class used for configuring your environment and running commands.
P4Exception is used as part of error reporting and is derived from the Ruby RuntimeError class.
The following utility classes defined by P4/Ruby are used to provide a structured interface for examining the results of certain specific Perforce commands. Currently the only command that enjoys this support is "p4 filelog", but others will be added on an as-needed basis.