def extract(uri, processor=nil)
      match_data = self.match(uri, processor)
      return (match_data ? match_data.mapping : nil)
    end
def extract(uri, processor=nil)
      match_data = self.match(uri, processor)
      return (match_data ? match_data.mapping : nil)
    end
Extracts a mapping from the URI using a URI Template pattern.

 @param [Addressable::URI, #to_str] uri
   The URI to extract from.

 @param [#restore, #match] processor
   A template processor object may optionally be supplied.

   The object should respond to either the <tt>restore</tt> or
   <tt>match</tt> messages or both. The <tt>restore</tt> method should
   take two parameters: `[String] name` and `[String] value`.
   The <tt>restore</tt> method should reverse any transformations that
   have been performed on the value to ensure a valid URI.
   The <tt>match</tt> method should take a single
   parameter: `[String] name`.  The <tt>match</tt> method should return
   a <tt>String</tt> containing a regular expression capture group for
   matching on that particular variable. The default value is `".*?"`.
   The <tt>match</tt> method has no effect on multivariate operator
   expansions.

 @return [Hash, NilClass]
   The <tt>Hash</tt> mapping that was extracted from the URI, or
   <tt>nil</tt> if the URI didn't match the template.

 @example
   class ExampleProcessor
     def self.restore(name, value)
       return value.gsub(/\+/, " ") if name == "query"
       return value
     end

     def self.match(name)
       return ".*?" if name == "first"
       return ".*"
     end
   end

   uri = Addressable::URI.parse(
     "http://example.com/search/an+example+search+query/"
   )
   Addressable::Template.new(
     "http://example.com/search/{query}/"
   ).extract(uri, ExampleProcessor)
   #=> {"query" => "an example search query"}

   uri = Addressable::URI.parse("http://example.com/a/b/c/")
   Addressable::Template.new(
     "http://example.com/{first}/{second}/"
   ).extract(uri, ExampleProcessor)
   #=> {"first" => "a", "second" => "b/c"}

   uri = Addressable::URI.parse("http://example.com/a/b/c/")
   Addressable::Template.new(
     "http://example.com/{first}/{-list|/|second}/"
   ).extract(uri)
   #=> {"first" => "a", "second" => ["b", "c"]}