Class: ClientAuth::Signer
- Inherits:
-
Object
- Object
- ClientAuth::Signer
- Defined in:
- lib/client_auth/signer.rb
Instance Attribute Summary collapse
-
#client_name ⇒ Object
readonly
Returns the value of attribute client_name.
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
- #configure(client_key, client_name) ⇒ Object
- #headers ⇒ Object
-
#initialize(method, path, params = {}) ⇒ Signer
constructor
A new instance of Signer.
Constructor Details
#initialize(method, path, params = {}) ⇒ Signer
Returns a new instance of Signer.
5 6 7 8 9 |
# File 'lib/client_auth/signer.rb', line 5 def initialize(method, path, params = {}) @method = method.upcase @path = path @payload = params end |
Instance Attribute Details
#client_name ⇒ Object (readonly)
Returns the value of attribute client_name.
3 4 5 |
# File 'lib/client_auth/signer.rb', line 3 def client_name @client_name end |
#payload ⇒ Object
Returns the value of attribute payload.
3 4 5 |
# File 'lib/client_auth/signer.rb', line 3 def payload @payload end |
Instance Method Details
#configure(client_key, client_name) ⇒ Object
25 26 27 28 |
# File 'lib/client_auth/signer.rb', line 25 def configure(client_key, client_name) @client_key = client_key @client_name = client_name end |
#headers ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/client_auth/signer.rb', line 15 def headers raise NotImplementedError, 'Client name not configured' unless client_name { 'X-Client' => client_name, 'X-Timestamp' => , 'X-Signature' => signature } end |