Sha256: 2a1f0be55e4d819f6a07919b37c2ef413d49cd41b395e7ca315cb9bbe7031416

Contents?: true

Size: 676 Bytes

Versions: 1

Compression:

Stored size: 676 Bytes

Contents

class Token < ActiveRecord::Base
  belongs_to :user
  validates_presence_of :key, :secret
  
  def client
    self.class.client
  end
  
  def consumer
    self.class.consumer
  end
  
  def service_name
    self.class.service_name
  end
  
  def get(path)
    
  end
  
  class << self
    def service_name
      @service_name ||= self.to_s.underscore.scan(/^(.*?)(_token)?$/)[0][0].to_sym
    end
    
    def client
      raise "implement client in subclass"
    end
    
    def consumer
      raise "implement consumer in subclass"
    end
    
    protected
    
    def credentials
      @credentials ||= AuthlogicConnect.credentials(service_name)
    end
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
authlogic-connect-0.0.2 lib/authlogic_connect/token.rb