lib/github_api/users.rb in github_api-0.8.1 vs lib/github_api/users.rb in github_api-0.8.2
- old
+ new
@@ -38,9 +38,30 @@
# Access to Users::Keys API
def keys
@keys ||= ApiFactory.new 'Users::Keys'
end
+ # List all users.
+ #
+ # This provides a dump of every user, in the order that they signed up
+ # for GitHub.
+ #
+ # = Parameters
+ # * <tt>:since</tt> - The integer ID of the last User that you’ve seen.
+ #
+ # = Examples
+ # users = Github::Users.new
+ # users.list
+ #
+ def list(params={})
+ normalize! params
+
+ response = get_request("/users", params)
+ return response unless block_given?
+ response.each { |el| yield el }
+ end
+ alias :all :list
+
# Get a single unauthenticated user
#
# = Examples
# github = Github.new
# github.users.get user: 'user-name'