A few things:

1)If you delete :max_versions from opts, you'll mutate the opts hash that the user provided and might want to reuse. You should avoid this.

Instead you could do

    options = opts.dup
    @max_versions = options.delete(:max_versions)

or

    @max_versions = opts[:max_versions]

The second is desirable because you're not creating a second variable.

2) If you reference a key that doesn't exist in the hash, you'll get nil. So there is no reason to have || nil.