Class: PriceHubble::Authentication
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- PriceHubble::Authentication
- Defined in:
- lib/pricehubble/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
Methods included from Utils::Bangers
Methods included from EntityConcern::Persistence
#destroyed?, #mark_as_destroyed, #new_record?, #persisted?
Methods included from EntityConcern::Client
Methods included from EntityConcern::Associations
has_many, has_one, inherited_setup_associations
Methods included from EntityConcern::Attributes
#assign_attributes, #attributes, inherited_setup_attributes, tracked_attr, typed_attr
Methods included from EntityConcern::Attributes::StringInquirer
Methods included from EntityConcern::Attributes::Range
Methods included from EntityConcern::Attributes::Enum
Methods included from EntityConcern::Attributes::DateArray
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/pricehubble/entity/authentication.rb', line 17 def created_at @created_at end |
#expires_at ⇒ Object (readonly)
Add some runtime attributes
17 18 19 |
# File 'lib/pricehubble/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/pricehubble/entity/authentication.rb', line 30 def expired? Time.current >= expires_at end |