# frozen_string_literal: true require 'roda/endpoints' class Roda module Endpoints # Generic HTTP endpoint abstraction. module Repository # @param [] _kwargs def list(**_kwargs) root.to_a end # @return [Time] def last_modified root.order(Sequel.desc(:updated_at)).first.updated_at end # @param [Integer] id # @return [ROM::Struct] def fetch(id) root.fetch(id.to_i) end end end end