Class: Git2Mite::User

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ User



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

def initialize(attributes = {})
  self.name = attributes[:name]
  self.id = attributes[:id]
end

Instance Attribute Details

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/git2mite/user.rb', line 3

def id
  @id
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/git2mite/user.rb', line 3

def name
  @name
end

Class Method Details

.all(mite_client) ⇒ Object



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

def self.all(mite_client)
  mite_client.get('/users.json').map do |json|
    User.new :name => json['user']['name'], :id => json['user']['id']
  end
end