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.
44 45 46 47 48 49 |
# File 'lib/jeff.rb', line 44 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.
42 43 44 |
# File 'lib/jeff.rb', line 42 def host @host end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
42 43 44 |
# File 'lib/jeff.rb', line 42 def method @method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
42 43 44 |
# File 'lib/jeff.rb', line 42 def path @path end |
#query_string ⇒ Object (readonly)
Returns the value of attribute query_string.
42 43 44 |
# File 'lib/jeff.rb', line 42 def query_string @query_string end |
Instance Method Details
#sign_with(aws_secret_access_key) ⇒ Object
51 52 53 |
# File 'lib/jeff.rb', line 51 def sign_with(aws_secret_access_key) Signature.new(aws_secret_access_key).sign(string_to_sign) end |
#string_to_sign ⇒ Object
55 56 57 |
# File 'lib/jeff.rb', line 55 def string_to_sign [method, host, path, query_string].join("\n") end |