Class: Altcha::V2::Solution
- Inherits:
-
Object
- Object
- Altcha::V2::Solution
- Defined in:
- lib/altcha/v2.rb
Overview
The solution produced by V2.solve_challenge.
Instance Attribute Summary collapse
-
#counter ⇒ Object
Returns the value of attribute counter.
-
#derived_key ⇒ Object
Returns the value of attribute derived_key.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(counter:, derived_key:, time: nil) ⇒ Solution
constructor
A new instance of Solution.
- #to_h ⇒ Object
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(counter:, derived_key:, time: nil) ⇒ Solution
Returns a new instance of Solution.
109 110 111 112 113 |
# File 'lib/altcha/v2.rb', line 109 def initialize(counter:, derived_key:, time: nil) @counter = counter @derived_key = derived_key @time = time end |
Instance Attribute Details
#counter ⇒ Object
Returns the value of attribute counter.
107 108 109 |
# File 'lib/altcha/v2.rb', line 107 def counter @counter end |
#derived_key ⇒ Object
Returns the value of attribute derived_key.
107 108 109 |
# File 'lib/altcha/v2.rb', line 107 def derived_key @derived_key end |
#time ⇒ Object
Returns the value of attribute time.
107 108 109 |
# File 'lib/altcha/v2.rb', line 107 def time @time end |
Instance Method Details
#to_h ⇒ Object
115 116 117 |
# File 'lib/altcha/v2.rb', line 115 def to_h { 'counter' => counter, 'derivedKey' => derived_key } end |
#to_json(options = {}) ⇒ Object
119 120 121 |
# File 'lib/altcha/v2.rb', line 119 def to_json( = {}) to_h.to_json() end |