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)


14
15
16
# File 'lib/easy_auth/models/identity.rb', line 14

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



21
22
23
# File 'lib/easy_auth/models/identity.rb', line 21

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