Skip to content

Commit

Permalink
remove repository boilerplate and outcome usages
Browse files Browse the repository at this point in the history
  • Loading branch information
gtrias committed Sep 3, 2024
1 parent d2479d6 commit c2914c6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
25 changes: 0 additions & 25 deletions lib/public/repositories/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,31 +38,6 @@ def read(dto:, context:)
raise_error(__method__)
end

sig { overridable.params(dto: T.untyped).returns(Outcome[Entity]) }
def create(dto:)
raise_error(__method__)
end

sig { overridable.params(dto: T.untyped).returns(Outcome[Entity]) }
def update(dto:)
raise_error(__method__)
end

sig { overridable.params(dto: T.untyped).returns(Outcome[Entity]) }
def delete(dto:)
raise_error(__method__)
end

sig { params(dto: T.untyped).returns(Outcome[Entity]) }
def find(dto:)
read(dto: dto).entities.map do |array|
entity = array.first
return Outcome.missing_resource if entity.nil?

entity
end
end

sig { overridable.params(entity: Entity, tags: T::Set[T.untyped]).returns(T::Hash[Symbol, T.untyped]) }
def serialize(entity:, tags: [])
serializer.serialize(entity: entity, tags: tags)
Expand Down
3 changes: 0 additions & 3 deletions lib/public/repositories/outcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ module Outcome
Elem = type_member(:out)

interface!

sig { abstract.returns(Elem) }
def unwrap!; end
end
end
end

0 comments on commit c2914c6

Please sign in to comment.