Class: IronBank::Authentications::Cookie
- Inherits:
-
Object
- Object
- IronBank::Authentications::Cookie
- Defined in:
- lib/iron_bank/authentications/cookie.rb
Overview
Get a cookie to enable authenticated calls to Zuora through Session.
Constant Summary collapse
- TEN_MINUTES =
600
- ONE_HOUR =
3600
Instance Method Summary collapse
- #expired? ⇒ Boolean
- #header ⇒ Object
-
#initialize(client_id:, client_secret:, base_url:) ⇒ Cookie
constructor
A new instance of Cookie.
Constructor Details
#initialize(client_id:, client_secret:, base_url:) ⇒ Cookie
Returns a new instance of Cookie.
11 12 13 14 15 16 |
# File 'lib/iron_bank/authentications/cookie.rb', line 11 def initialize(client_id:, client_secret:, base_url:) @client_id = client_id @client_secret = client_secret @base_url = base_url end |
Instance Method Details
#expired? ⇒ Boolean
18 19 20 21 |
# File 'lib/iron_bank/authentications/cookie.rb', line 18 def expired? # Ten minutes as a margin of error in order to renew token in time expires_at < Time.now + TEN_MINUTES end |
#header ⇒ Object
23 24 25 |
# File 'lib/iron_bank/authentications/cookie.rb', line 23 def header { "Cookie" => use } end |