Sha256: d9a656c2e2f40be1109c76682c7ab94cc5e7aeb69df61e0c5d0f46736ea60654

Contents?: true

Size: 328 Bytes

Versions: 8

Compression:

Stored size: 328 Bytes

Contents

module Doorkeeper
  module Models
    module Expirable
      def expired?
        expires_in && Time.now > expired_time
      end

      def time_left
        expired? ? 0 : expired_time - Time.now
      end

      def expired_time
        created_at + expires_in.seconds
      end
      private :expired_time
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
doorkeeper-0.4.2 lib/doorkeeper/models/expirable.rb
doorkeeper-0.4.1 lib/doorkeeper/models/expirable.rb
doorkeeper-0.4.0 lib/doorkeeper/models/expirable.rb
doorkeeper-0.3.4 lib/doorkeeper/models/expirable.rb
doorkeeper-0.3.3 lib/doorkeeper/models/expirable.rb
doorkeeper-0.3.2 lib/doorkeeper/models/expirable.rb
doorkeeper-0.3.1 lib/doorkeeper/models/expirable.rb
doorkeeper-0.3.0 lib/doorkeeper/models/expirable.rb