Skip to content

Commit

Permalink
Doc: document BarcodeValidation::GTIN
Browse files Browse the repository at this point in the history
Having a few lines to outline the purpose of a class and its neighbours
tends to help understanding and exploration of a codebase.
  • Loading branch information
Narnach committed Sep 20, 2022
1 parent a324144 commit 91d8c97
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/barcodevalidation/gtin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
require_relative "invalid_gtin"

module BarcodeValidation
# GTIN is responsible for wrapping input in an appropriate GTIN::Base sub-class.
# An important part of this involves managing the prioritized list of GTIN classes we use for handling input.
# The methods implemented here are used by GTIN::Base to manage this list and prioritize classes.
module GTIN
class << self
def new(input)
Expand All @@ -14,7 +17,7 @@ def new(input)
# Classes can prioritize themselves before others to implement subsets or other means of overlapping ranges.
#
# @api private Only for internal use.
# @see GTIN::Base.prioritize_before For when you want to manipulte priorities.
# @see GTIN::Base.prioritize_before For when you want to manipulate priorities.
# @see GTIN::Base.abstract_class For when you want to make a GTIN class abstract (i.e. not included in this list)
def prioritized_gtin_classes
@prioritized_gtin_classes ||= []
Expand Down

0 comments on commit 91d8c97

Please sign in to comment.