Sha256: 8c727cc2251783658346ae2d3a189dcba3b7b33eb26390d1dd8546cac90c31b3
Contents?: true
Size: 932 Bytes
Versions: 18
Compression:
Stored size: 932 Bytes
Contents
require 'hanami/utils/string' module Hanami module Action # Routing helper for full stack Hanami web applications. # # For a given application called <tt>Web::Application</tt>, at runtime # Hanami creates a routes factory called <tt>Web::Routes</tt>. # # Included by default in every controller. # # @since 0.3.2 # # @example Usage in controller # require 'hanami' # # module Web::Controllers::Protected # class Index # include Web::Action # # def call(params) # redirect_to routes.root_path # end # end # end module RoutingHelpers def self.included(base) factory = "#{Utils::String.namespace(base)}.routes" base.class_eval <<-END_EVAL, __FILE__, __LINE__ private def routes #{factory} end END_EVAL end end end end
Version data entries
18 entries across 18 versions & 1 rubygems