Sha256: 94c43b2a4de333fd1a1e4ebb777a86c7f9732f34e8a1fc435d129952d7698960

Contents?: true

Size: 413 Bytes

Versions: 2

Compression:

Stored size: 413 Bytes

Contents

module Touth
  module ActiveRecordSupport
    module ClassMethods

      def has_access_token
        include Touth::ActiveRecordSupport::InstanceMethods
      end

    end

    module InstanceMethods
 
      def access_token(*args)
        Authenticator.issue_access_token self, *args
      end

      def valid_access_token?(token)
        Authenticator.get_resource(token) == self
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
touth-1.3.0 lib/touth/active_record_support.rb
touth-1.2.0 lib/touth/active_record_support.rb