Class: Lolita::Extensions::Authentication::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/lolita/extensions/authentication/proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context, options = {}) ⇒ Proxy

Returns a new instance of Proxy.



13
14
15
16
17
# File 'lib/lolita/extensions/authentication/proxy.rb', line 13

def initialize context,options={}
  @context = context
  @options = options
  @adapter = get_adapter()
end

Instance Attribute Details

#adapterObject

Returns the value of attribute adapter.



11
12
13
# File 'lib/lolita/extensions/authentication/proxy.rb', line 11

def adapter
  @adapter
end

Instance Method Details

#authenticate_user!Object



27
28
29
# File 'lib/lolita/extensions/authentication/proxy.rb', line 27

def authenticate_user!
  @adapter.authenticate_user!
end

#current_userObject



19
20
21
# File 'lib/lolita/extensions/authentication/proxy.rb', line 19

def current_user
  @adapter.current_user
end

#default_adapter?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/lolita/extensions/authentication/proxy.rb', line 43

def default_adapter?
  self.adapter.is_a?(Lolita::Extensions::Authentication::DefaultAdapter)
end

#edit_pathObject



35
36
37
# File 'lib/lolita/extensions/authentication/proxy.rb', line 35

def edit_path
  @adapter.edit_path unless default_adapter?
end

#sign_out_pathObject



39
40
41
# File 'lib/lolita/extensions/authentication/proxy.rb', line 39

def sign_out_path
  @adapter.sign_out_path unless default_adapter?
end

#sign_out_viaObject



31
32
33
# File 'lib/lolita/extensions/authentication/proxy.rb', line 31

def sign_out_via
  @adapter.sign_out_via unless default_adapter?
end

#user_signed_in?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/lolita/extensions/authentication/proxy.rb', line 23

def user_signed_in?
  @adapter.user_signed_in?
end