Sha256: 2e0dedd947cc71fef2d9e5ed59a17d9f472af51378f1bfb1448e135c054a2aec
Contents?: true
Size: 1.13 KB
Versions: 7
Compression:
Stored size: 1.13 KB
Contents
<%- @modules.each do |module_name| %><%= " "* @indent %>module <%= module_name.camelize %><%- @indent += 1 %> <%- end %><%=" "* @indent %>class <%= @file_name %> < Hyperloop::Router <%=" "* @indent %> <%=" "* @indent %> route do <%=" "* @indent %> DIV do <%=" "* @indent %> "<%= (@modules+[@file_name]).join('::') %>" <%=" "* @indent %> # define routes using the Route psuedo component. Examples: <%=" "* @indent %> # Route('/foo', mounts: Foo) : match the path beginning with /foo and mount component Foo here <%=" "* @indent %> # Route('/foo') { Foo(...) } : display the contents of the block <%=" "* @indent %> # Route('/', exact: true, mounts: Home) : match the exact path / and mount the Home component <%=" "* @indent %> # Route('/user/:id/name', mounts: UserName) : path segments beginning with a colon will be captured in the match param <%=" "* @indent %> # see the hyper-router gem documentation for more details <%=" "* @indent %> end <%=" "* @indent %> end <%=" "* @indent %>end <%- @modules.each do %><%- @indent -= 1 %><%=" "* @indent %>end <%- end %>
Version data entries
7 entries across 7 versions & 1 rubygems