Method: Github::Gists#list
- Defined in:
- lib/github_api/gists.rb
#list(*args) ⇒ Object Also known as: all
List a user’s gists.
Examples
github = Github.new
github.gists.list user: 'user-name'
List the authenticated user’s gists or if called anonymously, this will returns all public gists
Examples
github = Github.new :oauth_token => '...'
github.gists.list
List all public gists
github = Github.new
github.gists.list :public
38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/github_api/gists.rb', line 38 def list(*args) params = arguments(args).params response = if (user = params.delete('user')) get_request("/users/#{user}/gists", params) elsif args.map(&:to_s).include?('public') get_request("/gists/public", params) else get_request("/gists", params) end return response unless block_given? response.each { |el| yield el } end |