Class: Prevoty::EncryptResult
- Inherits:
-
Object
- Object
- Prevoty::EncryptResult
- Defined in:
- lib/prevoty/responses/encrypt_result.rb
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
readonly
Returns the value of attribute algorithm.
-
#cipher_text ⇒ Object
readonly
Returns the value of attribute cipher_text.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#mac ⇒ Object
readonly
Returns the value of attribute mac.
-
#mac_key ⇒ Object
readonly
Returns the value of attribute mac_key.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
Instance Method Summary collapse
-
#initialize(data) ⇒ EncryptResult
constructor
A new instance of EncryptResult.
- #to_json(*a) ⇒ Object
Constructor Details
#initialize(data) ⇒ EncryptResult
Returns a new instance of EncryptResult.
5 6 7 8 9 10 11 12 |
# File 'lib/prevoty/responses/encrypt_result.rb', line 5 def initialize(data) @algorithm = data["algorithm"] @mode = data["mode"] @mac_key = data["mac_key"] @key = data["key"] @mac = data["mac"] @cipher_text = data["cipher_text"] end |
Instance Attribute Details
#algorithm ⇒ Object (readonly)
Returns the value of attribute algorithm.
3 4 5 |
# File 'lib/prevoty/responses/encrypt_result.rb', line 3 def algorithm @algorithm end |
#cipher_text ⇒ Object (readonly)
Returns the value of attribute cipher_text.
3 4 5 |
# File 'lib/prevoty/responses/encrypt_result.rb', line 3 def cipher_text @cipher_text end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
3 4 5 |
# File 'lib/prevoty/responses/encrypt_result.rb', line 3 def key @key end |
#mac ⇒ Object (readonly)
Returns the value of attribute mac.
3 4 5 |
# File 'lib/prevoty/responses/encrypt_result.rb', line 3 def mac @mac end |
#mac_key ⇒ Object (readonly)
Returns the value of attribute mac_key.
3 4 5 |
# File 'lib/prevoty/responses/encrypt_result.rb', line 3 def mac_key @mac_key end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
3 4 5 |
# File 'lib/prevoty/responses/encrypt_result.rb', line 3 def mode @mode end |
Instance Method Details
#to_json(*a) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/prevoty/responses/encrypt_result.rb', line 14 def to_json(*a) { algorithm: @algorithm, mode: @mode, mac_key: @mac_key, key: @key, mac: @mac, cipher_text: @cipher_text }.to_json end |