Class: ApiSignature::Signature

Inherits:
Object
  • Object
show all
Defined in:
lib/api_signature/signature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_requestString (readonly)

Returns For debugging purposes.

Returns:

  • (String)

    For debugging purposes.



17
18
19
# File 'lib/api_signature/signature.rb', line 17

def canonical_request
  @canonical_request
end

#content_sha256String (readonly)

Returns For debugging purposes.

Returns:

  • (String)

    For debugging purposes.



23
24
25
# File 'lib/api_signature/signature.rb', line 23

def content_sha256
  @content_sha256
end

#headersHash<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’.

Returns:

  • (Hash<String,String>)

    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

#signatureString (readonly)

Returns For debugging purposes.

Returns:

  • (String)

    For debugging purposes.



26
27
28
# File 'lib/api_signature/signature.rb', line 26

def signature
  @signature
end

#string_to_signString (readonly)

Returns For debugging purposes.

Returns:

  • (String)

    For debugging purposes.



20
21
22
# File 'lib/api_signature/signature.rb', line 20

def string_to_sign
  @string_to_sign
end