Sha256: 384386950baa78f5610a431883f0e6bd5393a9d5aef46a817894ab1c049df70e

Contents?: true

Size: 1.06 KB

Versions: 15

Compression:

Stored size: 1.06 KB

Contents

require 'hanami/routing/resource'
require 'hanami/routing/resources/action'

module Hanami
  module Routing
    # Set of RESTful resources routes
    # Implementation of Hanami::Router#resources
    #
    # @since 0.1.0
    #
    # @api private
    #
    # @see Hanami::Router#resources
    class Resources < Resource
      # Set of default routes
      #
      # @api private
      # @since 0.1.0
      self.actions = [:index, :new, :create, :show, :edit, :update, :destroy]

      # Action class
      #
      # @api private
      # @since 0.1.0
      self.action = Resources::Action

      # Member action class
      #
      # @api private
      # @since 0.1.0
      self.member = Resources::MemberAction

      # Collection action class
      #
      # @api private
      # @since 0.1.0
      self.collection = Resources::CollectionAction

      # Return wildcard param between separators
      #
      # @api private
      # @since 0.4.0
      def wildcard_param(route_param = nil)
        "/:#{ Hanami::Utils::String.singularize(route_param) }_id/"
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
hanami-router-1.3.2 lib/hanami/routing/resources.rb
hanami-router-1.3.1 lib/hanami/routing/resources.rb
hanami-router-1.3.0 lib/hanami/routing/resources.rb
hanami-router-1.3.0.beta1 lib/hanami/routing/resources.rb
hanami-router-1.2.0 lib/hanami/routing/resources.rb
hanami-router-1.2.0.rc2 lib/hanami/routing/resources.rb
hanami-router-1.2.0.rc1 lib/hanami/routing/resources.rb
hanami-router-1.2.0.beta2 lib/hanami/routing/resources.rb
hanami-router-1.2.0.beta1 lib/hanami/routing/resources.rb
hanami-router-1.1.1 lib/hanami/routing/resources.rb
hanami-router-1.1.0 lib/hanami/routing/resources.rb
hanami-router-1.1.0.rc1 lib/hanami/routing/resources.rb
hanami-router-1.1.0.beta3 lib/hanami/routing/resources.rb
hanami-router-1.1.0.beta2 lib/hanami/routing/resources.rb
hanami-router-1.1.0.beta1 lib/hanami/routing/resources.rb