Class: Zxcvbn::Match

Inherits:
Object
  • Object
show all
Defined in:
lib/zxcvbn/match.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ Match

Returns a new instance of Match.



12
13
14
15
16
# File 'lib/zxcvbn/match.rb', line 12

def initialize(**attributes)
  attributes.each do |key, value|
    instance_variable_set("@#{key}", value)
  end
end

Instance Attribute Details

#ascendingObject

Returns the value of attribute ascending.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def ascending
  @ascending
end

#base_entropyObject

Returns the value of attribute base_entropy.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def base_entropy
  @base_entropy
end

#cardinalityObject

Returns the value of attribute cardinality.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def cardinality
  @cardinality
end

#dayObject

Returns the value of attribute day.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def day
  @day
end

#dictionary_nameObject

Returns the value of attribute dictionary_name.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def dictionary_name
  @dictionary_name
end

#entropyObject

Returns the value of attribute entropy.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def entropy
  @entropy
end

#graphObject

Returns the value of attribute graph.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def graph
  @graph
end

#iObject

Returns the value of attribute i.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def i
  @i
end

#jObject

Returns the value of attribute j.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def j
  @j
end

#lObject

Returns the value of attribute l.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def l
  @l
end

#l33tObject

Returns the value of attribute l33t.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def l33t
  @l33t
end

#l33t_entropyObject

Returns the value of attribute l33t_entropy.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def l33t_entropy
  @l33t_entropy
end

#matched_wordObject

Returns the value of attribute matched_word.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def matched_word
  @matched_word
end

#monthObject

Returns the value of attribute month.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def month
  @month
end

#offsetObject

Returns the value of attribute offset.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def offset
  @offset
end

#patternObject

Returns the value of attribute pattern.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def pattern
  @pattern
end

#rankObject

Returns the value of attribute rank.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def rank
  @rank
end

#repeated_charObject

Returns the value of attribute repeated_char.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def repeated_char
  @repeated_char
end

#reversedObject

Returns the value of attribute reversed.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def reversed
  @reversed
end

#separatorObject

Returns the value of attribute separator.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def separator
  @separator
end

#sequence_nameObject

Returns the value of attribute sequence_name.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def sequence_name
  @sequence_name
end

#sequence_spaceObject

Returns the value of attribute sequence_space.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def sequence_space
  @sequence_space
end

#shiffted_countObject

Returns the value of attribute shiffted_count.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def shiffted_count
  @shiffted_count
end

#shifted_countObject

Returns the value of attribute shifted_count.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def shifted_count
  @shifted_count
end

#subObject

Returns the value of attribute sub.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def sub
  @sub
end

#sub_displayObject

Returns the value of attribute sub_display.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def sub_display
  @sub_display
end

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def token
  @token
end

#turnsObject

Returns the value of attribute turns.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def turns
  @turns
end

#uppercase_entropyObject

Returns the value of attribute uppercase_entropy.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def uppercase_entropy
  @uppercase_entropy
end

#yearObject

Returns the value of attribute year.



5
6
7
# File 'lib/zxcvbn/match.rb', line 5

def year
  @year
end

Instance Method Details

#to_hashObject



18
19
20
21
22
23
# File 'lib/zxcvbn/match.rb', line 18

def to_hash
  instance_variables.sort.each_with_object({}) do |var, hash|
    key = var.to_s.delete_prefix('@')
    hash[key] = instance_variable_get(var)
  end
end