Class: Notificon::UserState
- Inherits:
-
Object
- Object
- Notificon::UserState
- Defined in:
- lib/notificon/user_state.rb
Instance Attribute Summary collapse
-
#username ⇒ Object
readonly
Public : Gets the username.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ UserState
constructor
A new instance of UserState.
-
#notifications ⇒ Object
Public : Gets the number of unread notifications.
Constructor Details
#initialize(attrs) ⇒ UserState
Returns a new instance of UserState.
13 14 15 16 |
# File 'lib/notificon/user_state.rb', line 13 def initialize(attrs) @username = attrs['username'] @_notifications = attrs['notifications'] end |
Instance Attribute Details
#username ⇒ Object (readonly)
Public : Gets the username
6 7 8 |
# File 'lib/notificon/user_state.rb', line 6 def username @username end |
Instance Method Details
#notifications ⇒ Object
Public : Gets the number of unread notifications
9 10 11 |
# File 'lib/notificon/user_state.rb', line 9 def notifications @_notifications ||= 0 end |