Sha256: 4937b1e8d04b36da1b28965f6732d05180f41529c9305386b2db2940b7317582

Contents?: true

Size: 767 Bytes

Versions: 22

Compression:

Stored size: 767 Bytes

Contents

# frozen_string_literal: true

module Hanami
  class Slice
    # Hanami app routes helpers
    #
    # An instance of this class will be registered with slice (at the "routes" key). You
    # can use it to access the route helpers for your app.
    #
    # @example
    #   MyApp::App["routes"].path(:root) # => "/"
    #
    # @see Hanami::Router::UrlHelpers
    # @since 2.0.0
    class RoutesHelper
      # @since 2.0.0
      # @api private
      def initialize(router)
        @router = router
      end

      # @see Hanami::Router::UrlHelpers#path
      def path(...)
        router.path(...)
      end

      # @see Hanami::Router::UrlHelpers#url
      def url(...)
        router.url(...)
      end

      private

      attr_reader :router
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
hanami-2.2.1 lib/hanami/slice/routes_helper.rb
hanami-2.2.0 lib/hanami/slice/routes_helper.rb
hanami-2.2.0.rc1 lib/hanami/slice/routes_helper.rb
hanami-2.2.0.beta2 lib/hanami/slice/routes_helper.rb
hanami-2.2.0.beta1 lib/hanami/slice/routes_helper.rb
hanami-2.1.0 lib/hanami/slice/routes_helper.rb
hanami-2.1.0.rc3 lib/hanami/slice/routes_helper.rb
hanami-2.1.0.rc2 lib/hanami/slice/routes_helper.rb
hanami-2.1.0.rc1 lib/hanami/slice/routes_helper.rb
hanami-2.1.0.beta2.1 lib/hanami/slice/routes_helper.rb
hanami-2.1.0.beta2 lib/hanami/slice/routes_helper.rb
hanami-2.1.0.beta1 lib/hanami/slice/routes_helper.rb
hanami-2.0.3 lib/hanami/slice/routes_helper.rb
hanami-2.0.2 lib/hanami/slice/routes_helper.rb
hanami-2.0.1 lib/hanami/slice/routes_helper.rb
hanami-2.0.0 lib/hanami/slice/routes_helper.rb
hanami-2.0.0.rc1 lib/hanami/slice/routes_helper.rb
hanami-2.0.0.beta4 lib/hanami/slice/routes_helper.rb
hanami-2.0.0.beta3 lib/hanami/slice/routes_helper.rb
hanami-2.0.0.beta2 lib/hanami/slice/routes_helper.rb