Class: Omniauth::Social::Service

Inherits:
Object
  • Object
show all
Defined in:
lib/omniauth/social/service.rb

Defined Under Namespace

Classes: Failure, Success

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(auth, controller) ⇒ Service

Returns a new instance of Service.



5
6
7
8
# File 'lib/omniauth/social/service.rb', line 5

def initialize(auth, controller)
  @provider_data = auth.env['omniauth.auth']
  @controller    = controller
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



3
4
5
# File 'lib/omniauth/social/service.rb', line 3

def controller
  @controller
end

#provider_dataObject (readonly)

Returns the value of attribute provider_data.



3
4
5
# File 'lib/omniauth/social/service.rb', line 3

def provider_data
  @provider_data
end

Instance Method Details

#executeObject



10
11
12
13
14
15
16
# File 'lib/omniauth/social/service.rb', line 10

def execute
  if 
    yield(PostService::Success, PostService::Failure)
  else
    yield(PostService::Failure, PostService::Success)
  end
end