Class: Kawaii::Match
- Inherits:
-
Object
- Object
- Kawaii::Match
- Defined in:
- lib/kawaii/matchers.rb
Overview
Result of matching a path.
Instance Attribute Summary (collapse)
-
- (Object) params
readonly
Hash containing params extracted from paths such as /users/:user_id/posts/:post_id.
-
- (Object) remaining_path
readonly
What is left of the actual path after Kawaii::Matcher#match consumed the matching portion.
Instance Method Summary (collapse)
-
- (Match) initialize(remaining_path, params = {})
constructor
Creates a new match result.
Constructor Details
- (Match) initialize(remaining_path, params = {})
Creates a new match result.
16 17 18 19 |
# File 'lib/kawaii/matchers.rb', line 16 def initialize(remaining_path, params = {}) @remaining_path = remaining_path @params = params end |
Instance Attribute Details
- (Object) params (readonly)
Hash containing params extracted from paths such as /users/:user_id/posts/:post_id
10 11 12 |
# File 'lib/kawaii/matchers.rb', line 10 def params @params end |
- (Object) remaining_path (readonly)
What is left of the actual path after Kawaii::Matcher#match consumed the matching portion.
7 8 9 |
# File 'lib/kawaii/matchers.rb', line 7 def remaining_path @remaining_path end |