Class: ApiSignature::Signature
- Inherits:
-
Object
- Object
- ApiSignature::Signature
- Defined in:
- lib/api_signature/signature.rb
Instance Attribute Summary collapse
-
#canonical_request ⇒ String
readonly
For debugging purposes.
-
#content_sha256 ⇒ String
readonly
For debugging purposes.
-
#headers ⇒ Hash<String,String>
readonly
A hash of headers that should be applied to the HTTP request.
-
#signature ⇒ String
readonly
For debugging purposes.
-
#string_to_sign ⇒ String
readonly
For debugging purposes.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Signature
constructor
A new instance of Signature.
Constructor Details
#initialize(attributes) ⇒ Signature
Returns a new instance of Signature.
28 29 30 31 32 |
# File 'lib/api_signature/signature.rb', line 28 def initialize(attributes) attributes.each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#canonical_request ⇒ String (readonly)
Returns For debugging purposes.
17 18 19 |
# File 'lib/api_signature/signature.rb', line 17 def canonical_request @canonical_request end |
#content_sha256 ⇒ String (readonly)
Returns For debugging purposes.
23 24 25 |
# File 'lib/api_signature/signature.rb', line 23 def content_sha256 @content_sha256 end |
#headers ⇒ Hash<String,String> (readonly)
Returns A hash of headers that should be applied to the HTTP request. Header keys are lower cased strings and may include the following:
-
‘host’
-
‘x-date’
-
‘x-content-sha256’
-
‘authorization’.
14 15 16 |
# File 'lib/api_signature/signature.rb', line 14 def headers @headers end |
#signature ⇒ String (readonly)
Returns For debugging purposes.
26 27 28 |
# File 'lib/api_signature/signature.rb', line 26 def signature @signature end |
#string_to_sign ⇒ String (readonly)
Returns For debugging purposes.
20 21 22 |
# File 'lib/api_signature/signature.rb', line 20 def string_to_sign @string_to_sign end |