Class: Rubolite::Repo

Inherits:
Object
  • Object
show all
Defined in:
lib/rubolite/repo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name = nil) ⇒ Repo

Returns a new instance of Repo.



6
7
8
9
# File 'lib/rubolite/repo.rb', line 6

def initialize(name=nil)
  @name = name
  @users = []
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/rubolite/repo.rb', line 3

def name
  @name
end

#usersObject (readonly)

Returns the value of attribute users.



4
5
6
# File 'lib/rubolite/repo.rb', line 4

def users
  @users
end

Instance Method Details

#add_user(user) ⇒ Object



11
12
13
# File 'lib/rubolite/repo.rb', line 11

def add_user(user)
  (@users ||= []) << user
end