If neither `api_source` nor `location_path` are required options (as you've indicated you can pass `nil`), why not just:

```ruby
def install(cookbook, version, options = {})
  # ...
  cookbooks[cookbook][:api_source] = options[:api_source] if options.has_key?(:api_source)
```