def expand(behavior = nil, values = {})
      behavior, values = nil, behavior if behavior.is_a? Hash
      values = map_values(values)

      case behavior || additional_values
      when :raise  then @api_expander.expand(values)
      when :ignore then with_rest(values) { |uri, rest| uri }
      when :append then with_rest(values) { |uri, rest| append(uri, rest) }
      else raise ArgumentError, "unknown behavior %p" % behavior
      end
    end
def expand(behavior = nil, values = {})
      behavior, values = nil, behavior if behavior.is_a? Hash
      values = map_values(values)

      case behavior || additional_values
      when :raise  then @api_expander.expand(values)
      when :ignore then with_rest(values) { |uri, rest| uri }
      when :append then with_rest(values) { |uri, rest| append(uri, rest) }
      else raise ArgumentError, "unknown behavior %p" % behavior
      end
    end
@example Expanding a pattern
   pattern = Mustermann::Expander.new('/:name', '/:name.:ext')
   pattern.expand(name: 'hello')             # => "/hello"
   pattern.expand(name: 'hello', ext: 'png') # => "/hello.png"

 @example Handling additional values
   pattern = Mustermann::Expander.new('/:name', '/:name.:ext')
   pattern.expand(:ignore, name: 'hello', ext: 'png', scale: '2x') # => "/hello.png"
   pattern.expand(:append, name: 'hello', ext: 'png', scale: '2x') # => "/hello.png?scale=2x"
   pattern.expand(:raise,  name: 'hello', ext: 'png', scale: '2x') # raises Mustermann::ExpandError

 @example Setting additional values behavior for the expander object
   pattern = Mustermann::Expander.new('/:name', '/:name.:ext', additional_values: :append)
   pattern.expand(name: 'hello', ext: 'png', scale: '2x') # => "/hello.png?scale=2x"

 @param [Symbol] behavior
   What to do with additional key/value pairs not present in the values hash.
   Possible options: :raise, :ignore, :append.

 @param [Hash{Symbol: #to_s, Array<#to_s>}] values
   Values to use for expansion.

 @return [String] expanded string
 @raise [NotImplementedError] raised if expand is not supported.
 @raise [Mustermann::ExpandError] raised if a value is missing or unknown