Sha256: e7651b9cee1351c73757a3f29298a0402be1527704e62b77036cfbb09a0a0548

Contents?: true

Size: 1.06 KB

Versions: 12

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.new(route_param).singularize }_id/"
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
hanami-router-1.0.1 lib/hanami/routing/resources.rb
hanami-router-1.0.0 lib/hanami/routing/resources.rb
hanami-router-1.0.0.rc1 lib/hanami/routing/resources.rb
hanami-router-1.0.0.beta3 lib/hanami/routing/resources.rb
hanami-router-1.0.0.beta2 lib/hanami/routing/resources.rb
hanami-router-1.0.0.beta1 lib/hanami/routing/resources.rb
hanami-router-0.8.1 lib/hanami/routing/resources.rb
hanami-router-0.8.0 lib/hanami/routing/resources.rb
hanami-router-0.7.0 lib/hanami/routing/resources.rb
hanami-router-0.6.2 lib/hanami/routing/resources.rb
hanami-router-0.6.1 lib/hanami/routing/resources.rb
hanami-router-0.6.0 lib/hanami/routing/resources.rb