class Versionomy::Format::Delimiter::IntegerFieldBuilder
This class defines methods that can be called from the block passed to Versionomy::Format::Delimiter::Builder#field if the field is of integer type.
Public Instance Methods
Recognize a letter-formatted integer field. That is, the value is formatted as an alphabetic letter where āaā represents 1, up to āzā representing 26.
Using the opts parameter, you can override any of the field's overall parsing options. You may also set the following additional options:
:case
-
Case-sensitivity of the letter. Possible values are
:upper
,:lower
, and:either
. Default is:either
.
# File lib/versionomy/format/delimiter.rb, line 542 def recognize_letter(opts_={}) @recognizers << Delimiter::AlphabeticIntegerRecognizer.new(@field, @default_opts.merge(opts_)) end
Recognize a numeric-formatted integer field. Using the opts parameter, you can override any of the field's overall parsing options. You may also set the following additional options:
:strip_leading_zeros
-
If false (the default), and a value has leading zeros, it is assumed that the field has a minimum width, and unparsing will always pad left with zeros to reach that minimum width. If set to true, leading zeros are stripped from a value, and this padding is never done.
# File lib/versionomy/format/delimiter.rb, line 524 def recognize_number(opts_={}) @recognizers << Delimiter::BasicIntegerRecognizer.new(@field, @default_opts.merge(opts_)) end