Module: Githubris::API::Gist
- Included in:
- Githubris::API
- Defined in:
- lib/githubris/api/gist.rb
Constant Summary collapse
- PUBLIC_GISTS_PATH =
'/gists/public'
Instance Method Summary collapse
Instance Method Details
#get_public_gists(options = {}) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/githubris/api/gist.rb', line 15 def get_public_gists(={}) login = .delete(:user) return get_user_public_gists(login) if login data = self.class.get public_gists_path_for_page([:page]) @builder.build_gists data end |
#get_user_public_gists(login) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/githubris/api/gist.rb', line 6 def get_user_public_gists(login) data = self.class.get user_gists_path(login) gists = @builder.build_gists(data) gists.map do |gist| gist.set_attribute(:user, get_user(login)) gist end end |