Class: Enstratus::RequestSigner
- Inherits:
-
Object
- Object
- Enstratus::RequestSigner
- Defined in:
- lib/enstratus/request_signer.rb
Instance Attribute Summary collapse
-
#access_key ⇒ Object
Returns the value of attribute access_key.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#request ⇒ Object
Returns the value of attribute request.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
-
#sig ⇒ Object
readonly
Returns the value of attribute sig.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(request = {:method => 'GET', :path => ''}) ⇒ RequestSigner
constructor
A new instance of RequestSigner.
Constructor Details
#initialize(request = {:method => 'GET', :path => ''}) ⇒ RequestSigner
Returns a new instance of RequestSigner.
7 8 9 10 11 12 13 |
# File 'lib/enstratus/request_signer.rb', line 7 def initialize(request={:method => 'GET', :path => ''}) @access_key ||= Enstratus.configuration.access_key @secret_key ||= Enstratus.configuration.secret_key @request ||= request @sig = sign @headers = {"User-agent" => Enstratus::UA, "x-esauth-access" => "#{@access_key}", "x-esauth-timestamp" => "#{@timestamp}", "x-esauth-signature" => @sig, "x-es-details" => "basic", "Accept" => "application/json"} end |
Instance Attribute Details
#access_key ⇒ Object
Returns the value of attribute access_key.
3 4 5 |
# File 'lib/enstratus/request_signer.rb', line 3 def access_key @access_key end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
4 5 6 |
# File 'lib/enstratus/request_signer.rb', line 4 def headers @headers end |
#request ⇒ Object
Returns the value of attribute request.
3 4 5 |
# File 'lib/enstratus/request_signer.rb', line 3 def request @request end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
3 4 5 |
# File 'lib/enstratus/request_signer.rb', line 3 def secret_key @secret_key end |
#sig ⇒ Object (readonly)
Returns the value of attribute sig.
4 5 6 |
# File 'lib/enstratus/request_signer.rb', line 4 def sig @sig end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
4 5 6 |
# File 'lib/enstratus/request_signer.rb', line 4 def @timestamp end |