Sha256: 219fdc32fa6b404a57286b8c8c60617f0382142e3b0aeaabba40d4ac73e773d5

Contents?: true

Size: 624 Bytes

Versions: 6

Compression:

Stored size: 624 Bytes

Contents

module {{namespace_module}}
  module {{resource_module}}
    class Endpoint
      include {{resource_module}}
      include Shogun::Endpoint

      def initialize(router:)
        router.push route: route(verb: :get, control: List::Control)
        router.push route: route(verb: :post, control: Create::Control)
        router.push route: route(verb: :get, matcher: /(?<id>.+)/, control: Show::Control)
        router.push route: route(verb: :patch, matcher: /(?<id>.+)/, control: Update::Control)
        router.push route: route(verb: :delete, matcher: /(?<id>.+)/, control: Destroy::Control)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shogun-6.4.2 scaffold/generate/resource/endpoint.rb
shogun-6.4.1 scaffold/generate/resource/endpoint.rb
shogun-6.4.0 scaffold/generate/resource/endpoint.rb
shogun-6.3.0 scaffold/generate/resource/endpoint.rb
shogun-6.2.3 scaffold/generate/resource/endpoint.rb
shogun-6.2.2 scaffold/generate/resource/endpoint.rb