class RuboCop::Cop::Utils::FormatString::FormatSequence
@see ruby-doc.org/core-2.6.3/Kernel.html#method-i-format<br><br>For more complex formatting, Ruby supports a reference by name.
type character.
flags, width, and precision indicators, then terminated with a field
A format sequence consists of a percent sign, followed by optional<br><br>“‘<br>%[width]type
“`
The syntax of a format sequence is as follows.
def annotated?
def annotated? name && @source.include?('<') end
def arity
def arity @source.scan('*').count + 1 end
def initialize(match)
def initialize(match) @source = match[0] @begin_pos = match.begin(0) @end_pos = match.end(0) @flags = match[:flags].to_s + match[:more_flags].to_s @width = match[:width] @precision = match[:precision] @name = match[:name] @type = match[:type] @arg_number = match[:arg_number] end
def max_digit_dollar_num
def max_digit_dollar_num @source.scan(DIGIT_DOLLAR).map { |(digit_dollar_num)| digit_dollar_num.to_i }.max end
def percent?
def percent? type == '%' end
def style
def style if annotated? :annotated elsif template? :template else :unannotated end end
def template?
def template? name && @source.include?('{') end