Class: Altcha::V1::Challenge
- Inherits:
-
Object
- Object
- Altcha::V1::Challenge
- Defined in:
- lib/altcha/v1.rb
Overview
A challenge sent to the client.
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
Returns the value of attribute algorithm.
-
#challenge ⇒ Object
Returns the value of attribute challenge.
-
#maxnumber ⇒ Object
Returns the value of attribute maxnumber.
-
#salt ⇒ Object
Returns the value of attribute salt.
-
#signature ⇒ Object
Returns the value of attribute signature.
Instance Method Summary collapse
-
#initialize(algorithm:, challenge:, maxnumber: nil, salt:, signature:) ⇒ Challenge
constructor
A new instance of Challenge.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(algorithm:, challenge:, maxnumber: nil, salt:, signature:) ⇒ Challenge
Returns a new instance of Challenge.
44 45 46 47 48 49 50 |
# File 'lib/altcha/v1.rb', line 44 def initialize(algorithm:, challenge:, maxnumber: nil, salt:, signature:) @algorithm = algorithm @challenge = challenge @maxnumber = maxnumber @salt = salt @signature = signature end |
Instance Attribute Details
#algorithm ⇒ Object
Returns the value of attribute algorithm.
42 43 44 |
# File 'lib/altcha/v1.rb', line 42 def algorithm @algorithm end |
#challenge ⇒ Object
Returns the value of attribute challenge.
42 43 44 |
# File 'lib/altcha/v1.rb', line 42 def challenge @challenge end |
#maxnumber ⇒ Object
Returns the value of attribute maxnumber.
42 43 44 |
# File 'lib/altcha/v1.rb', line 42 def maxnumber @maxnumber end |
#salt ⇒ Object
Returns the value of attribute salt.
42 43 44 |
# File 'lib/altcha/v1.rb', line 42 def salt @salt end |
#signature ⇒ Object
Returns the value of attribute signature.
42 43 44 |
# File 'lib/altcha/v1.rb', line 42 def signature @signature end |
Instance Method Details
#to_json(options = {}) ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/altcha/v1.rb', line 52 def to_json( = {}) { algorithm: @algorithm, challenge: @challenge, maxnumber: @maxnumber, salt: @salt, signature: @signature }.to_json() end |