lib/cerner/oauth1a/access_token.rb
# Public: Check whether the access token has expired, if #expires_at is not nil. By default
# (with no arguments), the method checks whether the token has expired based on the current
# time and a fudge factor of 300 seconds (5 minutes). Non-default argument values can be used
# to see whether the access token has expired at a different time and with a different fudge
# factor.
#
# now       - A Time instance to check the expiration information against. Defaults to
#             Time.now.
# fudge_sec - The number of seconds to remove from #expires_at to adjust the comparison.
#
# Returns true if the access token is expired or #expires_at is nil; false otherwise
Check whether the access token has expired, if #expires_at is not nil. By default
(with no arguments), the method checks whether the token has expired based on the current
time and a fudge factor of 300 seconds (5 minutes). Non-default argument values can be used
to see whether the access token has expired at a different time and with a different fudge
factor.

now       - A Time instance to check the expiration information against.

Returns true if the access token is expired or #expires_at is nil; false otherwise
Check whether the access token has expired if #expires_at is not nil . By default ( with no arguments ) the method checks whether the token has expired based on the current time and a fudge factor of 300 seconds ( 5 minutes ) . Non - default argument values can be used to see whether the access token has expired at a different time and with a different fudge factor . now - A Time instance to check the expiration information against . Returns true if the access token is expired or #expires_at is nil ; false otherwise
def expired?(now: Time.now, fudge_sec: 300)
        return true unless @expires_at
        now = Internal.convert_to_time(time: now, name: 'now')
        now.tv_sec >= @expires_at.tv_sec - fudge_sec
      end
def expired? ( now : Time . now , fudge_sec : 300 ) return true unless @expires_at now = Internal . convert_to_time ( time : now , name : 'now' ) now . tv_sec >= @expires_at . tv_sec - fudge_sec end
Public: Check whether the access token has expired, if #expires_at is not nil.
Public : Check whether the access token has expired if #expires_at is not nil .
# if @expires_at is nil, return true now
now
fudge_sec