Parent

Files

Addressable::Template::MatchData

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

Attributes

uri[R]

@return [Addressable::URI]

  The URI that the Template was matched against.
template[R]

@return [Addressable::Template]

  The Template used for the match.
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.

Public Instance Methods

captures() click to toggle source
Alias for: values
inspect() click to toggle source

Returns a String representation of the MatchData’s state.

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

     # File lib/addressable/template.rb, line 117
117:       def inspect
118:         sprintf("#<%s:%#0x RESULT:%s>",
119:           self.class.to_s, self.object_id, self.mapping.inspect)
120:       end
keys() click to toggle source
Alias for: variables
values() click to toggle source

@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.
     # File lib/addressable/template.rb, line 105
105:       def values
106:         @values ||= self.variables.inject([]) do |accu, key|
107:           accu << self.mapping[key]
108:           accu
109:         end
110:       end
Also aliased as: captures
variables() click to toggle source

@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.
    # File lib/addressable/template.rb, line 95
95:       def variables
96:         self.template.variables
97:       end
Also aliased as: keys

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.