Skip to content

Commit

Permalink
Merge pull request #85 from koic/integer_unification
Browse files Browse the repository at this point in the history
Integer Unification for Ruby 2.4.0+
  • Loading branch information
sqrrrl committed Jun 20, 2017
2 parents 92cce13 + 5e7b79b commit 7ae73a5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/signet/oauth_2/client.rb
Expand Up @@ -561,7 +561,7 @@ def principal=(new_person)
# Returns the number of seconds assertions are valid for
# Used only by the assertion grant type.
#
# @return [Fixnum] Assertion expiry, in seconds
# @return [Integer] Assertion expiry, in seconds
def expiry
return @expiry
end
Expand All @@ -570,7 +570,7 @@ def expiry
# Sets the number of seconds assertions are valid for
# Used only by the assertion grant type.
#
# @param [Fixnum, String] new_expiry
# @param [Integer, String] new_expiry
# Assertion expiry, in seconds
def expiry=(new_expiry)
@expiry = new_expiry ? new_expiry.to_i : nil
Expand Down Expand Up @@ -722,7 +722,7 @@ def decoded_id_token(public_key=nil, options = {})
##
# Returns the lifetime of the access token in seconds.
#
# @return [Fixnum] The access token lifetime.
# @return [Integer] The access token lifetime.
def expires_in
return @expires_in
end
Expand All @@ -731,7 +731,7 @@ def expires_in
# Sets the lifetime of the access token in seconds. Resets the issued
# timestamp.
#
# @param [String, Fixnum] new_expires_in
# @param [String, Integer] new_expires_in
# The access token lifetime.
def expires_in=(new_expires_in)
if new_expires_in != nil
Expand All @@ -753,7 +753,7 @@ def issued_at
##
# Sets the timestamp the access token was issued at.
#
# @param [String,Fixnum,Time] new_issued_at
# @param [String,Integer,Time] new_issued_at
# The access token issuance time.
def issued_at=(new_issued_at)
@issued_at = normalize_timestamp(new_issued_at)
Expand All @@ -776,7 +776,7 @@ def expires_at
##
# Limits the lifetime of the access token as number of seconds since
# the Epoch
# @param [String,Fixnum,Time] new_expires_at
# @param [String,Integer,Time] new_expires_at
# The access token issuance time.
def expires_at=(new_expires_at)
@expires_at = normalize_timestamp(new_expires_at)
Expand All @@ -795,7 +795,7 @@ def expired?
# Returns true if the access token has expired or expires within
# the next n seconds
#
# @param [Fixnum] sec
# @param [Integer] sec
# Max number of seconds from now where a token is still considered
# expired.
# @return [TrueClass, FalseClass]
Expand Down Expand Up @@ -1177,7 +1177,7 @@ def normalize_timestamp(time)
time
when String
Time.parse(time)
when Fixnum, Bignum
when Integer
Time.at(time)
else
fail "Invalid time value #{time}"
Expand Down

0 comments on commit 7ae73a5

Please sign in to comment.