Sha256: 743568bfd5467abea8e6173c9970df2fc1ac72a08b166fbfa4666b9a0a7dfc4b

Contents?: true

Size: 462 Bytes

Versions: 2

Compression:

Stored size: 462 Bytes

Contents

# frozen_string_literal: true

class Core::Repositories::<%= @scope_class %>::<%= @repository_class %> < Core::Repositories::AbstractRepository
  def initialize(params:)
    @params     = prepare! params, sanitize: true
  end

  def call(builder: true)
    resource = <%= @model_class %>.new(@params.to_h)
    unless resource.save
      return Failure build_errors(resource)
    end
    Success Core::Builders::<%= @subject_class %>.new(resource).build
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rider-kick-0.0.9 lib/generators/rider_kick/templates/domains/core/repositories/create.rb.tt
rider-kick-0.0.8 lib/generators/rider_kick/templates/domains/core/repositories/create.rb.tt