Class: Sorcery::Providers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/sorcery/providers/base.rb

Direct Known Subclasses

Facebook, Github, Google, Jira, Linkedin, Liveid, Twitter, Vk, Xing

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



12
13
14
# File 'lib/sorcery/providers/base.rb', line 12

def initialize
  @user_info_mapping = {}
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



5
6
7
# File 'lib/sorcery/providers/base.rb', line 5

def access_token
  @access_token
end

#callback_urlObject

Returns the value of attribute callback_url.



7
8
9
# File 'lib/sorcery/providers/base.rb', line 7

def callback_url
  @callback_url
end

#keyObject

Returns the value of attribute key.



7
8
9
# File 'lib/sorcery/providers/base.rb', line 7

def key
  @key
end

#original_callback_urlObject

Returns the value of attribute original_callback_url.



7
8
9
# File 'lib/sorcery/providers/base.rb', line 7

def original_callback_url
  @original_callback_url
end

#secretObject

Returns the value of attribute secret.



7
8
9
# File 'lib/sorcery/providers/base.rb', line 7

def secret
  @secret
end

#siteObject

Returns the value of attribute site.



7
8
9
# File 'lib/sorcery/providers/base.rb', line 7

def site
  @site
end

#stateObject

Returns the value of attribute state.



7
8
9
# File 'lib/sorcery/providers/base.rb', line 7

def state
  @state
end

#user_info_mappingObject

Returns the value of attribute user_info_mapping.



7
8
9
# File 'lib/sorcery/providers/base.rb', line 7

def 
  @user_info_mapping
end

Class Method Details

.descendantsObject

Ensure that all descendant classes are loaded before run this



21
22
23
# File 'lib/sorcery/providers/base.rb', line 21

def self.descendants
  ObjectSpace.each_object(Class).select { |klass| klass < self }
end

.nameObject



16
17
18
# File 'lib/sorcery/providers/base.rb', line 16

def self.name
  super.gsub(/Sorcery::Providers::/, '').downcase
end

Instance Method Details

#has_callback?Boolean

Returns:

  • (Boolean)


10
# File 'lib/sorcery/providers/base.rb', line 10

def has_callback?; true; end