Class: Session::SignIn::FormObject
- Inherits:
-
Object
- Object
- Session::SignIn::FormObject
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/session/sign_in/form_object.rb
Overview
Class used as to easily integrate a session form with some basic validation
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Class Method Summary collapse
-
.model_name ⇒ ActiveModel::Name
Defining this method allows us to use some ActiveModel patterns.
Instance Method Summary collapse
-
#sign_in ⇒ Isaca::Model::AuthenticateUser
This method will attempt to generate a session with the ISACA SSO service.
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'app/models/session/sign_in/form_object.rb', line 7 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
7 8 9 |
# File 'app/models/session/sign_in/form_object.rb', line 7 def username @username end |
Class Method Details
.model_name ⇒ ActiveModel::Name
Defining this method allows us to use some ActiveModel patterns. For example, forms will be identified as sign_in instead of session_sign_in_form_object.
23 24 25 |
# File 'app/models/session/sign_in/form_object.rb', line 23 def self.model_name ActiveModel::Name.new(self, nil, 'SignIn') end |
Instance Method Details
#sign_in ⇒ Isaca::Model::AuthenticateUser
This method will attempt to generate a session with the ISACA SSO service
15 16 17 |
# File 'app/models/session/sign_in/form_object.rb', line 15 def sign_in Isaca::Request::AuthenticateUser.get(username, password) if valid? end |