Sha256: 76cbde87797dd34dc77fccc70b6f73ddbd51842b8a46058548d336c955ded416

Contents?: true

Size: 907 Bytes

Versions: 5

Compression:

Stored size: 907 Bytes

Contents

module Adp
  module Connection

    class AccessToken
      attr_accessor :token
      attr_accessor :token_type
      attr_accessor :scope
      attr_accessor :expires_on
      attr_accessor :token
      attr_accessor :_expires_in

      # @return [Object]
      def initialize(config = nil)

        unless config.nil?
          self.token = config["access_token"]
          self.token_type = config["token_type"]
          self.scope = config["scope"]
          self.expires_in = config["expires_in"]
        end
      end

      # @return [Object]
      def expires_in=(value)
        unless value.nil?
          self._expires_in = value
          self.expires_on = Time.new() + self._expires_in
        end
        self.expires_on
      end

      # @return [Object]
      def expires_in
        return self._expires_in
      end

      def is_valid?
        return true;
      end
    end
  end
end


Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
adp-connection-0.1.5 lib/adp/access_token.rb
adp-connection-0.1.4 lib/adp/access_token.rb
adp-connection-0.1.3 lib/adp/access_token.rb
adp-connection-0.1.2 lib/adp/access_token.rb
adp-connection-0.1.1 lib/adp/access_token.rb