Sha256: bc799c2425932964ac7380cc9935d91f5c2bf23f93f3a60b21307eebeadbe4bc

Contents?: true

Size: 644 Bytes

Versions: 2

Compression:

Stored size: 644 Bytes

Contents

# frozen_string_literal: true

class Core::UseCases::<%= [@route_scope_class, @scope_class, @use_case_class].reject { |c| c.empty? }.join("::") %> < RiderKick::UseCases::AbstractUseCase
  contract do
    params(Core::UseCases::Contract::Default.new.call, Core::UseCases::Contract::Pagination.new.call) do
<% @contract_list.each do |field| -%>
      <%= field %>
<% end -%>
    end
  end
  # Set specific return monads at method 'result'
  include Dry::Monads::Do.for(:result)

  def result
    params = yield build_parameter!
    Core::Repositories::<%= @scope_class%>::<%= @repository_class%>.new(params: params).call(builder: true)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rider-kick-0.0.5 lib/generators/rider_kick/templates/domains/core/use_cases/list.rb.tt
rider-kick-0.0.4 lib/generators/rider_kick/templates/domains/core/use_cases/list.rb.tt