lib/hanami/routing/resources.rb in hanami-router-1.3.2 vs lib/hanami/routing/resources.rb in hanami-router-2.0.0.alpha1
- old
+ new
@@ -1,8 +1,10 @@
-require 'hanami/routing/resource'
-require 'hanami/routing/resources/action'
+# frozen_string_literal: true
+require "hanami/routing/resource"
+require "hanami/routing/resources/action"
+
module Hanami
module Routing
# Set of RESTful resources routes
# Implementation of Hanami::Router#resources
#
@@ -14,11 +16,11 @@
class Resources < Resource
# Set of default routes
#
# @api private
# @since 0.1.0
- self.actions = [:index, :new, :create, :show, :edit, :update, :destroy]
+ self.actions = %i[index new create show edit update destroy]
# Action class
#
# @api private
# @since 0.1.0
@@ -39,10 +41,10 @@
# Return wildcard param between separators
#
# @api private
# @since 0.4.0
def wildcard_param(route_param = nil)
- "/:#{ Hanami::Utils::String.singularize(route_param) }_id/"
+ "/:#{@router.inflector.singularize(route_param)}_id/"
end
end
end
end