Class: Utopia::Path::Matcher::MatchData
- Inherits:
-
Object
- Object
- Utopia::Path::Matcher::MatchData
- Defined in:
- lib/utopia/path/matcher.rb
Overview
The result of matching against a Utopia::Path.
Instance Attribute Summary collapse
-
#named_parts ⇒ Object
readonly
Matched components by name.
-
#post_match ⇒ Object
readonly
Any remaining part past the end of the explicitly matched components.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(named_parts, post_match) ⇒ MatchData
constructor
A new instance of MatchData.
- #names ⇒ Object
Constructor Details
Instance Attribute Details
#named_parts ⇒ Object (readonly)
Matched components by name.
24 25 26 |
# File 'lib/utopia/path/matcher.rb', line 24 def named_parts @named_parts end |
#post_match ⇒ Object (readonly)
Any remaining part past the end of the explicitly matched components.
27 28 29 |
# File 'lib/utopia/path/matcher.rb', line 27 def post_match @post_match end |
Instance Method Details
#[](key) ⇒ Object
29 30 31 |
# File 'lib/utopia/path/matcher.rb', line 29 def [] key @named_parts[key] end |
#names ⇒ Object
33 34 35 |
# File 'lib/utopia/path/matcher.rb', line 33 def names @named_parts.keys end |