Sha256: b2f83d200235685881d151fcb7a9e0036d7bb4f502a3276bd1f942bc25e8a165

Contents?: true

Size: 364 Bytes

Versions: 5

Compression:

Stored size: 364 Bytes

Contents

# frozen_string_literal: true

module Tikkie
  module Api
    # Access token that can be used to make API calls.
    class AccessToken
      attr_accessor :token

      def initialize(token, expires_in)
        @token = token
        @expires_at = Time.now + expires_in.to_i
      end

      def expired?
        Time.now > @expires_at
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tikkie-api-0.2.2 lib/tikkie/api/access_token.rb
tikkie-api-0.2.1 lib/tikkie/api/access_token.rb
tikkie-api-0.2.0 lib/tikkie/api/access_token.rb
tikkie-api-0.1.1 lib/tikkie/api/access_token.rb
tikkie-api-0.1.0 lib/tikkie/api/access_token.rb