Class: Zxcvbn::Match
- Defined in:
- lib/zxcvbn/match.rb,
sig/zxcvbn/match.rbs
Overview
A substring match found by one of the pattern matchers.
All attributes are optional and default to nil. Use #with to derive a
new match with changed attributes.
Constant Summary
Constants inherited from Data
Instance Attribute Summary collapse
-
#ascending ⇒ Boolean?
readonly
True if the sequence is ascending.
-
#base_guesses ⇒ Numeric?
readonly
Guesses for the base token (repeat matches) or rank before variation multipliers (dictionary matches).
-
#base_token ⇒ String?
readonly
The minimal repeating unit (repeat matches).
-
#day ⇒ Integer?
readonly
Matched day (date matches).
-
#dictionary_name ⇒ String?
readonly
Source dictionary name (dictionary matches).
-
#graph ⇒ String?
readonly
Keyboard graph name (spatial matches).
-
#guesses ⇒ Numeric?
readonly
Estimated guess count.
-
#guesses_log10 ⇒ Float?
readonly
Log10 of #guesses.
-
#i ⇒ Integer?
readonly
Start index in the password (inclusive).
-
#j ⇒ Integer?
readonly
End index in the password (inclusive).
-
#l33t ⇒ Boolean?
readonly
True when the match required l33t substitution.
-
#l33t_variations ⇒ Numeric?
readonly
L33t substitution variant count (dictionary matches).
-
#matched_word ⇒ String?
readonly
Lowercased dictionary word (dictionary matches).
-
#month ⇒ Integer?
readonly
Matched month (date matches).
-
#pattern ⇒ String?
readonly
The matcher that produced this match.
-
#rank ⇒ Integer?
readonly
Frequency rank of the matched word (dictionary matches).
-
#repeat_count ⇒ Integer?
readonly
Number of repetitions (repeat matches).
-
#reversed ⇒ Boolean?
readonly
True when matched in the reversed password.
-
#separator ⇒ String?
readonly
Date separator character (date matches).
-
#sequence_name ⇒ String?
readonly
Sequence type: "lower", "upper", "digits", or "unicode".
-
#sequence_space ⇒ Integer?
readonly
Size of the character set for the sequence.
-
#shifted_count ⇒ Integer?
readonly
Number of shifted characters (spatial matches).
-
#sub ⇒ Hash?
readonly
Map of l33t characters to their substituted letters.
-
#sub_display ⇒ String?
readonly
Human-readable substitution summary.
-
#token ⇒ String?
readonly
The matched substring.
-
#turns ⇒ Integer?
readonly
Number of direction changes (spatial matches).
-
#uppercase_variations ⇒ Numeric?
readonly
Capitalisation variant count (dictionary matches).
-
#year ⇒ Integer?
readonly
Matched year (date/year matches).
Attributes inherited from Data
#adjacency_graphs, #dictionaries, #graph_stats
Instance Method Summary collapse
-
#initialize(pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil) ⇒ Match
constructor
A new instance of Match.
-
#inspect ⇒ String
A human-readable representation omitting nil fields and token.
- #pretty_print(pp) ⇒ void
- #with ⇒ Match
Methods inherited from Data
#add_word_list, #build_tries, #compute_graph_stats, #dictionary_tries, #ranked_dictionaries, #read_word_list
Constructor Details
#initialize(pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil) ⇒ Match
Returns a new instance of Match.
73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/zxcvbn/match.rb', line 73 def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end |
Instance Attribute Details
#ascending ⇒ Boolean? (readonly)
Returns true if the sequence is ascending.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#base_guesses ⇒ Numeric? (readonly)
Returns guesses for the base token (repeat matches) or rank before variation multipliers (dictionary matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#base_token ⇒ String? (readonly)
Returns the minimal repeating unit (repeat matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#day ⇒ Integer? (readonly)
Returns matched day (date matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#dictionary_name ⇒ String? (readonly)
Returns source dictionary name (dictionary matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#graph ⇒ String? (readonly)
Returns keyboard graph name (spatial matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#guesses ⇒ Numeric? (readonly)
Returns estimated guess count.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#guesses_log10 ⇒ Float? (readonly)
Returns log10 of #guesses.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#i ⇒ Integer? (readonly)
Returns start index in the password (inclusive).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#j ⇒ Integer? (readonly)
Returns end index in the password (inclusive).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#l33t ⇒ Boolean? (readonly)
Returns true when the match required l33t substitution.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#l33t_variations ⇒ Numeric? (readonly)
Returns l33t substitution variant count (dictionary matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#matched_word ⇒ String? (readonly)
Returns lowercased dictionary word (dictionary matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#month ⇒ Integer? (readonly)
Returns matched month (date matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#pattern ⇒ String? (readonly)
Returns the matcher that produced this match.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#rank ⇒ Integer? (readonly)
Returns frequency rank of the matched word (dictionary matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#repeat_count ⇒ Integer? (readonly)
Returns number of repetitions (repeat matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#reversed ⇒ Boolean? (readonly)
Returns true when matched in the reversed password.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#separator ⇒ String? (readonly)
Returns date separator character (date matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#sequence_name ⇒ String? (readonly)
Returns sequence type: "lower", "upper", "digits", or "unicode".
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#sequence_space ⇒ Integer? (readonly)
Returns size of the character set for the sequence.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#shifted_count ⇒ Integer? (readonly)
Returns number of shifted characters (spatial matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#sub ⇒ Hash? (readonly)
Returns map of l33t characters to their substituted letters.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#sub_display ⇒ String? (readonly)
Returns human-readable substitution summary.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#token ⇒ String? (readonly)
Returns the matched substring.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#turns ⇒ Integer? (readonly)
Returns number of direction changes (spatial matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#uppercase_variations ⇒ Numeric? (readonly)
Returns capitalisation variant count (dictionary matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
#year ⇒ Integer? (readonly)
Returns matched year (date/year matches).
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/zxcvbn/match.rb', line 66 Match = ::Data.define( :pattern, :i, :j, :token, :matched_word, :rank, :dictionary_name, :reversed, :l33t, :sub, :sub_display, :guesses, :guesses_log10, :base_guesses, :uppercase_variations, :l33t_variations, :base_token, :repeat_count, :sequence_name, :sequence_space, :ascending, :graph, :turns, :shifted_count, :year, :month, :day, :separator ) do def initialize( pattern: nil, i: nil, j: nil, token: nil, matched_word: nil, rank: nil, dictionary_name: nil, reversed: nil, l33t: nil, sub: nil, sub_display: nil, guesses: nil, guesses_log10: nil, base_guesses: nil, uppercase_variations: nil, l33t_variations: nil, base_token: nil, repeat_count: nil, sequence_name: nil, sequence_space: nil, ascending: nil, graph: nil, turns: nil, shifted_count: nil, year: nil, month: nil, day: nil, separator: nil ) super end # @return [String] a human-readable representation omitting nil fields and token def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end # @param pp [PP] the pretty-printer instance # @return [void] def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end end |
Instance Method Details
#inspect ⇒ String
Returns a human-readable representation omitting nil fields and token.
86 87 88 89 |
# File 'lib/zxcvbn/match.rb', line 86 def inspect fields = to_h.reject { |k, v| v.nil? || k == :token }.map { |k, v| "#{k}=#{v.inspect}" }.join(', ') "#<data #{self.class} #{fields}>" end |
#pretty_print(pp) ⇒ void
This method returns an undefined value.
93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/zxcvbn/match.rb', line 93 def pretty_print(pp) fields = to_h.reject { |_, v| v.nil? } pp.group(1, "#<data #{self.class}", '>') do fields.each_with_index do |(k, v), i| pp.text(',') if i.positive? pp.breakable ' ' pp.text("#{k}=") v.pretty_print(pp) end end end |