Sha256: e586b63dd92c4b8883c5285b813cb6596b1e258a0b1f5eb5322af35a72155490

Contents?: true

Size: 465 Bytes

Versions: 6

Compression:

Stored size: 465 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

6 entries across 6 versions & 1 rubygems

Version Path
rider-kick-0.0.7 lib/generators/rider_kick/templates/domains/core/repositories/create.rb.tt
rider-kick-0.0.6 lib/generators/rider_kick/templates/domains/core/repositories/create.rb.tt
rider-kick-0.0.5 lib/generators/rider_kick/templates/domains/core/repositories/create.rb.tt
rider-kick-0.0.4 lib/generators/rider_kick/templates/domains/core/repositories/create.rb.tt
rider-kick-0.0.3 lib/generators/rider_kick/templates/domains/core/repositories/create.rb.tt
rider-kick-0.0.2 lib/generators/rider_kick/templates/domains/core/repositories/create.rb.tt