Follow the Brass

lib/batch_record.rb

13 lines · ruby

Project files
# frozen_string_literal: true

BatchRecord = Data.define(:load_specification, :brass_lot, :component_lots,
                          :cartridge_count) do
  def initialize(load_specification:, brass_lot:, component_lots:, cartridge_count:)
    super(load_specification:, brass_lot:,
          component_lots: component_lots.dup.freeze, cartridge_count:)
  end

  def label
    "#{brass_lot} / #{load_specification} / #{cartridge_count} rounds"
  end
end

Read along in the manual: The Reloading Lab · Download the project (zip)