Class: ChangeHealthcare::ProfessionalClaims::Wrapper::AuthToken
- Inherits:
-
Struct
- Object
- Struct
- ChangeHealthcare::ProfessionalClaims::Wrapper::AuthToken
- Defined in:
- lib/change_healthcare/professional_claims/wrapper.rb
Overview
Struct used to store auth tokens so we don't need to fetch one every request.
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#auth ⇒ Object
The actual auth header to pass in to things.
-
#valid? ⇒ Boolean
Is this token still usable?.
Instance Attribute Details
#expires_at ⇒ Object
Returns the value of attribute expires_at
94 95 96 |
# File 'lib/change_healthcare/professional_claims/wrapper.rb', line 94 def expires_at @expires_at end |
#token ⇒ Object
Returns the value of attribute token
94 95 96 |
# File 'lib/change_healthcare/professional_claims/wrapper.rb', line 94 def token @token end |
Instance Method Details
#auth ⇒ Object
The actual auth header to pass in to things
103 104 105 |
# File 'lib/change_healthcare/professional_claims/wrapper.rb', line 103 def auth "Bearer #{token}" end |
#valid? ⇒ Boolean
Is this token still usable?
97 98 99 |
# File 'lib/change_healthcare/professional_claims/wrapper.rb', line 97 def valid? expires_at > (Time.new - 20) end |