Sha256: 2e84d5ca76d89e3cca9099ac0942b5911213f987048d226793503db9ca6fc7f5

Contents?: true

Size: 563 Bytes

Versions: 6

Compression:

Stored size: 563 Bytes

Contents

# frozen_string_literal: true

require 'modern/descriptor/route'

module Modern
  class App
    class Router < Dry::Struct
      attribute :routes, Modern::Types::Strict::Array.of(
        Modern::Types.Instance(Modern::Descriptor::Route)
      )

      def initialize(inputs)
        super(inputs)
      end

      def resolve(_http_method, _path)
        raise "#{self.class.name}#resolve must be implemented."
      end

      private

      def process_routes
        raise "#{self.class.name}#process_routes must be implemented."
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
modern-0.5.0 lib/modern/app/router.rb
modern-0.4.6 lib/modern/app/router.rb
modern-0.4.5 lib/modern/app/router.rb
modern-0.4.4 lib/modern/app/router.rb
modern-0.4.3 lib/modern/app/router.rb
modern-0.4.2 lib/modern/app/router.rb