Class Addressable::Template::MatchData
In: lib/addressable/template.rb
Parent: Object

This class represents the data that is extracted when a Template is matched against a URI.

Methods

captures   inspect   keys   new   values   variables  

Attributes

mapping  [R]  @return [Hash]
  The mapping that resulted from the match.
  Note that this mapping does not include keys or values for
  variables that appear in the Template, but are not present
  in the URI.
template  [R]  @return [Addressable::Template]
  The Template used for the match.
uri  [R]  @return [Addressable::URI]
  The URI that the Template was matched against.

Public Class methods

Creates a new MatchData object. MatchData objects should never be instantiated directly.

@param [Addressable::URI] uri

  The URI that the template was matched against.

Public Instance methods

captures()

Alias for values

Returns a String representation of the MatchData‘s state.

@return [String] The MatchData‘s state, as a String.

keys()

Alias for variables

@return [Array]

  The list of values that were captured by the Template.
  Note that this list will include nils for any variables which
  were in the Template, but did not appear in the URI.

@return [Array]

  The list of variables that were present in the Template.
  Note that this list will include variables which do not appear
  in the mapping because they were not present in URI.

[Validate]