Class: Cul::Omniauth::AbilityProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/cul/omniauth/ability_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ AbilityProxy

Returns a new instance of AbilityProxy.



4
5
6
7
8
9
10
11
12
# File 'lib/cul/omniauth/ability_proxy.rb', line 4

def initialize(opts = {})
  self.mime_type = opts[:mime_type]
  self.context = opts[:context]
  self.content_models = opts[:content_models] || []
  self.publisher = opts[:publisher] || []
  self.remote_ip = opts[:remote_ip] || []
  self.user_id = opts[:user_id] || []
  self.user_roles = opts[:user_roles] || []
end

Instance Attribute Details

#content_modelsObject

Returns the value of attribute content_models.



3
4
5
# File 'lib/cul/omniauth/ability_proxy.rb', line 3

def content_models
  @content_models
end

#contextObject

Returns the value of attribute context.



3
4
5
# File 'lib/cul/omniauth/ability_proxy.rb', line 3

def context
  @context
end

#mime_typeObject

Returns the value of attribute mime_type.



3
4
5
# File 'lib/cul/omniauth/ability_proxy.rb', line 3

def mime_type
  @mime_type
end

#publisherObject

Returns the value of attribute publisher.



3
4
5
# File 'lib/cul/omniauth/ability_proxy.rb', line 3

def publisher
  @publisher
end

#remote_ipObject

Returns the value of attribute remote_ip.



3
4
5
# File 'lib/cul/omniauth/ability_proxy.rb', line 3

def remote_ip
  @remote_ip
end

#user_idObject

Returns the value of attribute user_id.



3
4
5
# File 'lib/cul/omniauth/ability_proxy.rb', line 3

def user_id
  @user_id
end

#user_rolesObject

Returns the value of attribute user_roles.



3
4
5
# File 'lib/cul/omniauth/ability_proxy.rb', line 3

def user_roles
  @user_roles
end

Instance Method Details

#to_hObject



13
14
15
16
17
18
19
20
21
# File 'lib/cul/omniauth/ability_proxy.rb', line 13

def to_h
  return {
    mime_type: mime_type(),
    context: context(),
    content_models: content_models(),
    publisher: publisher(),
    remote_ip: remote_ip()
  }
end