Class: AccessToken

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/authlogic_connect/access_token.rb

Direct Known Subclasses

OauthToken, OpenidToken

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.api_version(value = nil) ⇒ Object



50
51
52
# File 'lib/authlogic_connect/access_token.rb', line 50

def api_version(value = nil)
  config[:api]
end

.clientObject



33
34
35
# File 'lib/authlogic_connect/access_token.rb', line 33

def client
  raise "implement client in subclass"
end

.configObject



45
46
47
48
# File 'lib/authlogic_connect/access_token.rb', line 45

def config
  @settings ||= {}
  @settings.dup
end

.consumerObject



37
38
39
# File 'lib/authlogic_connect/access_token.rb', line 37

def consumer
  raise "implement consumer in subclass"
end

.service_nameObject



29
30
31
# File 'lib/authlogic_connect/access_token.rb', line 29

def service_name
  @service_name ||= self.to_s.underscore.scan(/^(.*?)(_token)?$/)[0][0].to_sym
end

.settings(site, hash = {}) ⇒ Object



41
42
43
# File 'lib/authlogic_connect/access_token.rb', line 41

def settings(site, hash = {})
  @settings = hash.merge(:site => site)
end

Instance Method Details

#clientObject



4
5
6
# File 'lib/authlogic_connect/access_token.rb', line 4

def client
  self.class.client
end

#configObject



20
21
22
# File 'lib/authlogic_connect/access_token.rb', line 20

def config
  self.class.config
end

#consumerObject



8
9
10
# File 'lib/authlogic_connect/access_token.rb', line 8

def consumer
  self.class.consumer
end

#get(path) ⇒ Object



24
25
26
# File 'lib/authlogic_connect/access_token.rb', line 24

def get(path)
  
end

#service_nameObject



12
13
14
# File 'lib/authlogic_connect/access_token.rb', line 12

def service_name
  self.class.service_name
end

#settingsObject



16
17
18
# File 'lib/authlogic_connect/access_token.rb', line 16

def settings
  self.class.settings
end