Class: Svenbot::User

Inherits:
Object
  • Object
show all
Defined in:
lib/svenbot/user.rb

Overview

A user who wishes to receive notifications about commits.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(jid) ⇒ User

Create a new user jid with no paths to monitor.



10
11
12
13
# File 'lib/svenbot/user.rb', line 10

def initialize(jid)
  @jid = jid
  @paths = []
end

Instance Attribute Details

#jidObject

The jabber ID of the user.



5
6
7
# File 'lib/svenbot/user.rb', line 5

def jid
  @jid
end

#pathsObject

A list of paths that the user wishes to be notified about.



7
8
9
# File 'lib/svenbot/user.rb', line 7

def paths
  @paths
end

Instance Method Details

#<<(path) ⇒ Object

Add a path to the list monitored.



16
17
18
19
# File 'lib/svenbot/user.rb', line 16

def <<(path)
  @paths << path
  return self
end

#delete(path) ⇒ Object

Remove a path from the list monitored.



22
23
24
# File 'lib/svenbot/user.rb', line 22

def delete(path)
  @paths.delete path
end