Class: Prevoty::EncryptResult

Inherits:
Object
  • Object
show all
Defined in:
lib/prevoty/responses/encrypt_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#algorithmObject (readonly)

Returns the value of attribute algorithm.



3
4
5
# File 'lib/prevoty/responses/encrypt_result.rb', line 3

def algorithm
  @algorithm
end

#cipher_textObject (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

#keyObject (readonly)

Returns the value of attribute key.



3
4
5
# File 'lib/prevoty/responses/encrypt_result.rb', line 3

def key
  @key
end

#macObject (readonly)

Returns the value of attribute mac.



3
4
5
# File 'lib/prevoty/responses/encrypt_result.rb', line 3

def mac
  @mac
end

#mac_keyObject (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

#modeObject (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