Sha256: 15cc1db7a28067c835f41961d26a71eb185a260dc3a335b8cb7d5303cc91ee2f

Contents?: true

Size: 480 Bytes

Versions: 139

Compression:

Stored size: 480 Bytes

Contents

# frozen_string_literal: true

require_dependency "renalware/letters"
require "attr_extras"

module Renalware
  module Letters
    class CompleteLetter
      include Broadcasting
      pattr_initialize :letter

      class << self
        alias_method :build, :new
      end

      def call(by:)
        Letter.transaction do
          @letter = letter.complete(by: by)
          letter.save!
          broadcast(:letter_completed, letter)
        end
      end
    end
  end
end

Version data entries

139 entries across 139 versions & 1 rubygems

Version Path
renalware-core-2.0.159 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.158 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.157 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.156 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.155 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.153 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.152 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.151 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.149 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.148 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.147 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.146 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.145 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.144 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.143 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.142 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.141 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.140 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.139 app/models/renalware/letters/complete_letter.rb
renalware-core-2.0.138 app/models/renalware/letters/complete_letter.rb