Sha256: 4898cb6de55442fc873a18e8661bcdb5dac1f67424baecd6c47c9f6c7f77d958
Contents?: true
Size: 510 Bytes
Versions: 2
Compression:
Stored size: 510 Bytes
Contents
module ValidRoute class RouteFormatter def initialize @buffer = [] end def result @buffer #.compact.uniq end def section_title(title) end def section(routes) @buffer << array_paths(routes) @buffer.flatten! end def header(routes) end def no_routes @buffer end private def array_paths(routes) regexp = "(.:format)" paths = [] routes.map do |r| paths << {path: r[:path].sub(regexp, ""), verb: r[:verb], reqs: r[:reqs] } end paths end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
valid_route-0.0.2 | lib/valid_route/route_formatter.rb |
valid_route-0.0.1 | lib/valid_route/route_formatter.rb |