Follow the Brass

lib/caliber_specification.rb

11 lines · ruby

Project files
# frozen_string_literal: true

CaliberSpecification = Data.define(:caliber, :maximum_case_length) do
  def covers?(other_caliber)
    caliber == other_caliber
  end

  def acceptable_length?(length)
    !length.nil? && length <= maximum_case_length
  end
end

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