Sha256: 0f695e2c173032936b92098954a1bf6ebab075e9d04fa5c466bbc36a07dc9aab

Contents?: true

Size: 854 Bytes

Versions: 13

Compression:

Stored size: 854 Bytes

Contents

class AccessToken < ActiveRecord::Base
  belongs_to :user
  
  def client
    self.class.client
  end
  
  def consumer
    self.class.consumer
  end
  
  def service_name
    self.class.service_name
  end
  
  def settings
    self.class.settings
  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
    
    def settings(site, hash = {})
      @settings = hash.merge(:site => site)
    end
    
    def config
      @settings ||= {}
      @settings.dup
    end
    
    protected
    
    def credentials
      @credentials ||= AuthlogicConnect.credentials(service_name)
    end
  end
  
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
authlogic-connect-andrewacove-0.5.7 lib/authlogic_connect/access_token.rb
authlogic-connect-0.0.5.1 lib/authlogic_connect/access_token.rb
authlogic-connect-0.0.5 lib/authlogic_connect/access_token.rb
authlogic-connect-andrewacove-0.5.6 lib/authlogic_connect/access_token.rb
authlogic-connect-andrewacove-0.5.5 lib/authlogic_connect/access_token.rb
authlogic-connect-andrewacove-0.5.4 lib/authlogic_connect/access_token.rb
authlogic-connect-andrewacove-0.5.2 lib/authlogic_connect/access_token.rb
authlogic-connect-andrewacove-0.5.0 lib/authlogic_connect/access_token.rb
authlogic-connect-0.0.4.06 lib/authlogic_connect/access_token.rb
authlogic-connect-x-0.0.4.05x lib/authlogic_connect/access_token.rb
authlogic-connect-0.0.4.05 lib/authlogic_connect/access_token.rb
authlogic-connect-0.0.4.04 lib/authlogic_connect/access_token.rb
authlogic-connect-0.0.4.03 lib/authlogic_connect/access_token.rb