Class: Altcha::V1::ServerSignaturePayload
- Inherits:
-
Object
- Object
- Altcha::V1::ServerSignaturePayload
- Defined in:
- lib/altcha/v1.rb
Overview
Payload for server-side signature verification.
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
Returns the value of attribute algorithm.
-
#signature ⇒ Object
Returns the value of attribute signature.
-
#verification_data ⇒ Object
Returns the value of attribute verification_data.
-
#verified ⇒ Object
Returns the value of attribute verified.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(algorithm:, verification_data:, signature:, verified:) ⇒ ServerSignaturePayload
constructor
A new instance of ServerSignaturePayload.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(algorithm:, verification_data:, signature:, verified:) ⇒ ServerSignaturePayload
Returns a new instance of ServerSignaturePayload.
101 102 103 104 105 106 |
# File 'lib/altcha/v1.rb', line 101 def initialize(algorithm:, verification_data:, signature:, verified:) @algorithm = algorithm @verification_data = verification_data @signature = signature @verified = verified end |
Instance Attribute Details
#algorithm ⇒ Object
Returns the value of attribute algorithm.
99 100 101 |
# File 'lib/altcha/v1.rb', line 99 def algorithm @algorithm end |
#signature ⇒ Object
Returns the value of attribute signature.
99 100 101 |
# File 'lib/altcha/v1.rb', line 99 def signature @signature end |
#verification_data ⇒ Object
Returns the value of attribute verification_data.
99 100 101 |
# File 'lib/altcha/v1.rb', line 99 def verification_data @verification_data end |
#verified ⇒ Object
Returns the value of attribute verified.
99 100 101 |
# File 'lib/altcha/v1.rb', line 99 def verified @verified end |
Class Method Details
.from_json(string) ⇒ Object
117 118 119 120 121 122 123 124 125 |
# File 'lib/altcha/v1.rb', line 117 def self.from_json(string) data = JSON.parse(string) new( algorithm: data['algorithm'], verification_data: data['verificationData'], signature: data['signature'], verified: data['verified'] ) end |
Instance Method Details
#to_json(options = {}) ⇒ Object
108 109 110 111 112 113 114 115 |
# File 'lib/altcha/v1.rb', line 108 def to_json( = {}) { algorithm: @algorithm, verificationData: @verification_data, signature: @signature, verified: @verified }.to_json() end |