struct LuckerRouter::PathReader

Overview

A PathReader parses a URI path into segments.

It can be used to read a String representing a full path into the individual segments it contains.

path = "/foo/bar/baz"
PathReader.new(path).to_a => ["", "foo", "bar", "baz"]

Percent-encoded characters are automatically decoded following segmentation

path = "/user/foo%40example.com/details"
PathReader.new(path).to_a => ["", "user", "foo@example.com", "details"]

Included Modules

Defined in:

lucky_router/path_reader.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(path : String) #

[View source]

Instance Method Detail

def each(&) #
Description copied from module Enumerable(String)

Must yield this collection's elements to the block.


[View source]