Class: Git2Mite::User
- Inherits:
-
Object
- Object
- Git2Mite::User
- Defined in:
- lib/git2mite/user.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ User
constructor
A new instance of User.
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
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/git2mite/user.rb', line 3 def id @id end |
#name ⇒ Object
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 |