Class: CryptApi::Main
- Inherits:
-
Object
- Object
- CryptApi::Main
- Extended by:
- EncryptFactory, Sender
- Defined in:
- lib/crypt_api.rb
Class Attribute Summary collapse
-
.encrypt_algorithm ⇒ Object
Returns the value of attribute encrypt_algorithm.
-
.make_signature ⇒ Object
Returns the value of attribute make_signature.
-
.secret_key ⇒ Object
Returns the value of attribute secret_key.
-
.signature_token ⇒ Object
Returns the value of attribute signature_token.
-
.url ⇒ Object
Returns the value of attribute url.
Class Method Summary collapse
- .decrypt_response(encrypted_response) ⇒ Object
- .send_encrypted_request(data) ⇒ Object
- .set_configs {|_self| ... } ⇒ Object
Methods included from EncryptFactory
decrypt_data, encrypt_data, make_signature
Methods included from Sender
Class Attribute Details
.encrypt_algorithm ⇒ Object
Returns the value of attribute encrypt_algorithm.
20 21 22 |
# File 'lib/crypt_api.rb', line 20 def encrypt_algorithm @encrypt_algorithm end |
.make_signature ⇒ Object
Returns the value of attribute make_signature.
20 21 22 |
# File 'lib/crypt_api.rb', line 20 def make_signature @make_signature end |
.secret_key ⇒ Object
Returns the value of attribute secret_key.
20 21 22 |
# File 'lib/crypt_api.rb', line 20 def secret_key @secret_key end |
.signature_token ⇒ Object
Returns the value of attribute signature_token.
20 21 22 |
# File 'lib/crypt_api.rb', line 20 def signature_token @signature_token end |
.url ⇒ Object
Returns the value of attribute url.
20 21 22 |
# File 'lib/crypt_api.rb', line 20 def url @url end |
Class Method Details
.decrypt_response(encrypted_response) ⇒ Object
32 33 34 |
# File 'lib/crypt_api.rb', line 32 def self.decrypt_response(encrypted_response) decrypt_data(encrypted_response, self.secret_key, self.encrypt_algorithm) end |
.send_encrypted_request(data) ⇒ Object
27 28 29 30 |
# File 'lib/crypt_api.rb', line 27 def self.send_encrypted_request(data) encrypted_data = encrypt_data(data.to_s, self.secret_key, self.encrypt_algorithm) post_data({data: encrypted_data}, self.url) end |
.set_configs {|_self| ... } ⇒ Object
23 24 25 |
# File 'lib/crypt_api.rb', line 23 def self.set_configs yield(self) end |