Class: Notificon::UserState

Inherits:
Object
  • Object
show all
Defined in:
lib/notificon/user_state.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#usernameObject (readonly)

Public : Gets the username



6
7
8
# File 'lib/notificon/user_state.rb', line 6

def username
  @username
end

Instance Method Details

#notificationsObject

Public : Gets the number of unread notifications



9
10
11
# File 'lib/notificon/user_state.rb', line 9

def notifications
  @_notifications ||= 0
end