Module: EasyAuth::Models::Identity::ClassMethods

Defined in:
lib/easy_auth/models/identity.rb

Instance Method Summary collapse

Instance Method Details

#authenticate(controller = nil) ⇒ Object

Base authentication method, should be implemented by child identities

Parameters:

  • controller (ActionController::Base) (defaults to: nil)

    instance of the controller

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/easy_auth/models/identity.rb', line 16

def authenticate(controller = nil)
  raise NotImplementedError
end

#new_session(controller) ⇒ Object

Base assumption for new sessions on the controller, will set ‘@identity` to a new instance of the identity

Parameters:

  • controller (ActionController::Base)

    instance of the controller



23
24
25
# File 'lib/easy_auth/models/identity.rb', line 23

def new_session(controller)
  controller.instance_variable_set(:@identity, self.new)
end