Class: Jeff::Signer
- Inherits:
-
Object
- Object
- Jeff::Signer
- Defined in:
- lib/jeff.rb
Overview
Signs an AWS request.
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#query_string ⇒ Object
readonly
Returns the value of attribute query_string.
Instance Method Summary collapse
-
#initialize(method, host, path, query_string) ⇒ Signer
constructor
A new instance of Signer.
- #sign_with(aws_secret_access_key) ⇒ Object
- #string_to_sign ⇒ Object
Constructor Details
#initialize(method, host, path, query_string) ⇒ Signer
Returns a new instance of Signer.
46 47 48 49 50 51 |
# File 'lib/jeff.rb', line 46 def initialize(method, host, path, query_string) @method = method.upcase @host = host @path = path @query_string = query_string end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
44 45 46 |
# File 'lib/jeff.rb', line 44 def host @host end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
44 45 46 |
# File 'lib/jeff.rb', line 44 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
44 45 46 |
# File 'lib/jeff.rb', line 44 def path @path end |
#query_string ⇒ Object (readonly)
Returns the value of attribute query_string.
44 45 46 |
# File 'lib/jeff.rb', line 44 def query_string @query_string end |
Instance Method Details
#sign_with(aws_secret_access_key) ⇒ Object
53 54 55 |
# File 'lib/jeff.rb', line 53 def sign_with(aws_secret_access_key) Signature.new(aws_secret_access_key).sign(string_to_sign) end |
#string_to_sign ⇒ Object
57 58 59 |
# File 'lib/jeff.rb', line 57 def string_to_sign [method, host, path, query_string].join("\n") end |