class OAuth2::AccessToken
def to_hash
-
(Hash)
- a hash of AccessToken property values
Other tags:
- Note: - Don't return expires_latency because it has already been deducted from expires_at
def to_hash hsh = { access_token: token, refresh_token: refresh_token, expires_at: expires_at, mode: options[:mode], header_format: options[:header_format], param_name: options[:param_name], } hsh[:token_name] = options[:token_name] if options.key?(:token_name) # TODO: Switch when dropping Ruby < 2.5 support # params.transform_keys(&:to_sym) # Ruby 2.5 only # Old Ruby transform_keys alternative: sheesh = @params.each_with_object({}) { |(k, v), memo| memo[k.to_sym] = v } sheesh.merge(hsh) end