Class: Altcha::ServerSignaturePayload
- Inherits:
-
Object
- Object
- Altcha::ServerSignaturePayload
- Defined in:
- lib/altcha.rb
Overview
Class representing the payload for server signatures.
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.
Instance Method Summary collapse
-
#from_json(string) ⇒ ServerSignaturePayload
Creates a ServerSignaturePayload object from a JSON string.
-
#to_json(options = {}) ⇒ String
Converts the ServerSignaturePayload object to a JSON string.
Instance Attribute Details
#algorithm ⇒ Object
Returns the value of attribute algorithm.
82 83 84 |
# File 'lib/altcha.rb', line 82 def algorithm @algorithm end |
#signature ⇒ Object
Returns the value of attribute signature.
82 83 84 |
# File 'lib/altcha.rb', line 82 def signature @signature end |
#verification_data ⇒ Object
Returns the value of attribute verification_data.
82 83 84 |
# File 'lib/altcha.rb', line 82 def verification_data @verification_data end |
#verified ⇒ Object
Returns the value of attribute verified.
82 83 84 |
# File 'lib/altcha.rb', line 82 def verified @verified end |
Instance Method Details
#from_json(string) ⇒ ServerSignaturePayload
Creates a ServerSignaturePayload object from a JSON string.
99 100 101 102 |
# File 'lib/altcha.rb', line 99 def from_json(string) data = JSON.parse(string) new data['algorithm'], data['verificationData'], data['signature'], data['verified'] end |
#to_json(options = {}) ⇒ String
Converts the ServerSignaturePayload object to a JSON string.
87 88 89 90 91 92 93 94 |
# File 'lib/altcha.rb', line 87 def to_json( = {}) { algorithm: @algorithm, verificationData: @verification_data, signature: @signature, verified: @verified }.to_json() end |