Class: LoginPresenter
- Inherits:
-
Object
- Object
- LoginPresenter
- Defined in:
- lib/glimmer-dsl-opal/samples/elaborate/login.rb
Overview
Presents login screen data
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#status ⇒ Object
Returns the value of attribute status.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
Instance Method Summary collapse
-
#initialize ⇒ LoginPresenter
constructor
A new instance of LoginPresenter.
- #logged_in ⇒ Object
- #logged_out ⇒ Object
- #login ⇒ Object
- #logout ⇒ Object
Constructor Details
#initialize ⇒ LoginPresenter
Returns a new instance of LoginPresenter.
10 11 12 13 14 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/login.rb', line 10 def initialize @user_name = "" @password = "" @status = "Logged Out" end |
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
7 8 9 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/login.rb', line 7 def password @password end |
#status ⇒ Object
Returns the value of attribute status.
8 9 10 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/login.rb', line 8 def status @status end |
#user_name ⇒ Object
Returns the value of attribute user_name.
6 7 8 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/login.rb', line 6 def user_name @user_name end |
Instance Method Details
#logged_in ⇒ Object
24 25 26 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/login.rb', line 24 def logged_in self.status == "Logged In" end |
#logged_out ⇒ Object
28 29 30 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/login.rb', line 28 def logged_out !self.logged_in end |
#login ⇒ Object
32 33 34 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/login.rb', line 32 def login self.status = "Logged In" end |
#logout ⇒ Object
36 37 38 39 40 |
# File 'lib/glimmer-dsl-opal/samples/elaborate/login.rb', line 36 def logout self.user_name = "" self.password = "" self.status = "Logged Out" end |