Skip to content

Commit

Permalink
fix entity finder
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrias committed Aug 26, 2024
1 parent 6dea8b7 commit d4d8dd1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 29 deletions.
29 changes: 0 additions & 29 deletions lib/entity_finder.rb

This file was deleted.

18 changes: 18 additions & 0 deletions lib/public/entity_finder.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# typed: strict

module ResourceRegistry
class EntityFinder
extend T::Sig

sig do
params(repository: T.class_of(Repositories::Base)).returns(T.nilable(T.class_of(T::Struct)))
end
def self.call(repository:)
entity = repository.entity

return nil if entity.is_a?(T::Types::Untyped)

entity
end
end
end
1 change: 1 addition & 0 deletions lib/resource_registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require 'public/resource'
require 'public/versions'
require 'public/versions/version'
require 'public/entity_finder'
require 'schema_registry/json_schema_mapper'
require 'schema_registry/maybe'
require 'runtime_generic'
Expand Down

0 comments on commit d4d8dd1

Please sign in to comment.