Class: Lolita::Extensions::Authorization::Proxy

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Proxy.



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

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

Instance Attribute Details

#adapterObject

Returns the value of attribute adapter.



12
13
14
# File 'lib/lolita/extensions/authorization/proxy.rb', line 12

def adapter
  @adapter
end

Instance Method Details

#authorize!(*args) ⇒ Object



28
29
30
# File 'lib/lolita/extensions/authorization/proxy.rb', line 28

def authorize! *args
  @adapter.authorize! *args
end

#can?(*args) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/lolita/extensions/authorization/proxy.rb', line 20

def can? *args
  @adapter.can? *args
end

#cannot?(*args) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/lolita/extensions/authorization/proxy.rb', line 24

def cannot? *args
  @adapter.cannot? *args
end

#current_ability(*args) ⇒ Object



32
33
34
# File 'lib/lolita/extensions/authorization/proxy.rb', line 32

def current_ability *args
  @adapter.current_ability *args
end