# frozen_string_literal: true class Roda module Endpoints # Generic HTTP endpoint abstraction. class Endpoint # Parameters validations for {Endpoints} based on `Dry::Validation` gem. module Operations def initialize(**kwargs) super(**kwargs) container.merge(Endpoints.container) self.class.verbs.each do |verb| container.register "operations.#{ns}.#{verb}", &method(verb) end end # @param [Symbol] verb # @return [String] def operation_for(verb) %W( operations.#{ns}.#{verb} operations.#{type}.#{verb} ).detect { |key| container.key?(key) } end end end end end