Class: PassForge::Analyzer::Result
- Inherits:
-
Object
- Object
- PassForge::Analyzer::Result
- Defined in:
- lib/passforge/analyzer.rb
Overview
Analysis result object
Instance Attribute Summary collapse
-
#crack_time ⇒ Object
readonly
Returns the value of attribute crack_time.
-
#entropy ⇒ Object
readonly
Returns the value of attribute entropy.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
-
#strength ⇒ Object
readonly
Returns the value of attribute strength.
-
#suggestions ⇒ Object
readonly
Returns the value of attribute suggestions.
Instance Method Summary collapse
-
#initialize(password:, score:, entropy:, crack_time:, strength:, suggestions:) ⇒ Result
constructor
A new instance of Result.
- #to_h ⇒ Object
Constructor Details
#initialize(password:, score:, entropy:, crack_time:, strength:, suggestions:) ⇒ Result
Returns a new instance of Result.
11 12 13 14 15 16 17 18 |
# File 'lib/passforge/analyzer.rb', line 11 def initialize(password:, score:, entropy:, crack_time:, strength:, suggestions:) @password = password @score = score @entropy = entropy @crack_time = crack_time @strength = strength @suggestions = suggestions end |
Instance Attribute Details
#crack_time ⇒ Object (readonly)
Returns the value of attribute crack_time.
9 10 11 |
# File 'lib/passforge/analyzer.rb', line 9 def crack_time @crack_time end |
#entropy ⇒ Object (readonly)
Returns the value of attribute entropy.
9 10 11 |
# File 'lib/passforge/analyzer.rb', line 9 def entropy @entropy end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
9 10 11 |
# File 'lib/passforge/analyzer.rb', line 9 def password @password end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
9 10 11 |
# File 'lib/passforge/analyzer.rb', line 9 def score @score end |
#strength ⇒ Object (readonly)
Returns the value of attribute strength.
9 10 11 |
# File 'lib/passforge/analyzer.rb', line 9 def strength @strength end |
#suggestions ⇒ Object (readonly)
Returns the value of attribute suggestions.
9 10 11 |
# File 'lib/passforge/analyzer.rb', line 9 def suggestions @suggestions end |
Instance Method Details
#to_h ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/passforge/analyzer.rb', line 20 def to_h { score: @score, entropy: @entropy.round(2), crack_time: @crack_time, strength: @strength, suggestions: @suggestions } end |