Class: Zxcvbn::Feedback
- Inherits:
-
Data
- Object
- Data
- Zxcvbn::Feedback
- Defined in:
- lib/zxcvbn/feedback.rb
Overview
Human-readable feedback for a low-scoring password.
Instance Attribute Summary collapse
-
#suggestions ⇒ Object
readonly
Returns the value of attribute suggestions.
-
#warning ⇒ Object
readonly
Returns the value of attribute warning.
Instance Method Summary collapse
-
#initialize(warning: nil, suggestions: []) ⇒ Feedback
constructor
A new instance of Feedback.
Constructor Details
#initialize(warning: nil, suggestions: []) ⇒ Feedback
Returns a new instance of Feedback.
13 14 15 |
# File 'lib/zxcvbn/feedback.rb', line 13 def initialize(warning: nil, suggestions: []) super(warning: warning || '', suggestions: suggestions.freeze) end |
Instance Attribute Details
#suggestions ⇒ Object (readonly)
Returns the value of attribute suggestions
10 11 12 13 14 15 16 |
# File 'lib/zxcvbn/feedback.rb', line 10 Feedback = ::Data.define(:warning, :suggestions) do # @param warning [String] warning message (default: empty string) # @param suggestions [Array<String>] improvement tips (default: []) def initialize(warning: nil, suggestions: []) super(warning: warning || '', suggestions: suggestions.freeze) end end |
#warning ⇒ Object (readonly)
Returns the value of attribute warning
10 11 12 13 14 15 16 |
# File 'lib/zxcvbn/feedback.rb', line 10 Feedback = ::Data.define(:warning, :suggestions) do # @param warning [String] warning message (default: empty string) # @param suggestions [Array<String>] improvement tips (default: []) def initialize(warning: nil, suggestions: []) super(warning: warning || '', suggestions: suggestions.freeze) end end |