Class: PriceHubble::Authentication
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- PriceHubble::Authentication
- Defined in:
- lib/price_hubble/entity/authentication.rb
Overview
The PriceHubble ecosystem is built around the authentication on each request. This entity provides a simple to use interface for it.
Constant Summary collapse
- EXPIRATION_LEEWAY =
The expiration leeway to substract to guarantee acceptance on remote application calls
5.minutes
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Add some runtime attributes.
-
#expires_at ⇒ Object
readonly
Add some runtime attributes.
Attributes inherited from BaseEntity
Instance Method Summary collapse
-
#expired? ⇒ Boolean
Allow to query whenever the current authentication instance is expired or not.
Methods inherited from BaseEntity
Constructor Details
This class inherits a constructor from PriceHubble::BaseEntity
Instance Attribute Details
#created_at ⇒ Object (readonly)
Add some runtime attributes
17 18 19 |
# File 'lib/price_hubble/entity/authentication.rb', line 17 def created_at @created_at end |
#expires_at ⇒ Object (readonly)
Add some runtime attributes
17 18 19 |
# File 'lib/price_hubble/entity/authentication.rb', line 17 def expires_at @expires_at end |
Instance Method Details
#expired? ⇒ Boolean
Allow to query whenever the current authentication instance is expired or not. This includes also a small leeway to ensure the acceptance is guaranteed.
30 31 32 |
# File 'lib/price_hubble/entity/authentication.rb', line 30 def expired? Time.current >= expires_at end |