Class: Bixby::EncryptedJsonRequest
- Inherits:
-
JsonRequest
- Object
- JsonRequest
- Bixby::EncryptedJsonRequest
- Defined in:
- lib/bixby-common/api/encrypted_json_request.rb
Instance Attribute Summary
Attributes inherited from JsonRequest
Instance Method Summary collapse
-
#initialize(json_request, private_key, public_key, uuid = "master") ⇒ EncryptedJsonRequest
constructor
A new instance of EncryptedJsonRequest.
- #to_wire ⇒ Object
Methods inherited from JsonRequest
Methods included from HttpClient
#http_get, #http_get_json, #http_post, #http_post_download, #http_post_json
Methods included from Jsonify
Methods included from Hashify
Constructor Details
#initialize(json_request, private_key, public_key, uuid = "master") ⇒ EncryptedJsonRequest
Returns a new instance of EncryptedJsonRequest.
5 6 7 8 9 10 11 12 |
# File 'lib/bixby-common/api/encrypted_json_request.rb', line 5 def initialize(json_request, private_key, public_key, uuid="master") self.operation = json_request.operation self.params = json_request.params # encrypt data = json_request.to_json @body = Bixby::CryptoUtil.encrypt(data, uuid, public_key, private_key) end |
Instance Method Details
#to_wire ⇒ Object
14 15 16 |
# File 'lib/bixby-common/api/encrypted_json_request.rb', line 14 def to_wire @body end |