Module: Octokit::Client::Traffic
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/traffic.rb
Overview
Methods for the Traffic API
Instance Method Summary collapse
-
#clones(repo, options = {}) ⇒ Sawyer::Resource
Get the total number of clones and breakdown per day or week for the last 14 days.
-
#top_paths(repo, options = {}) ⇒ Array<Sawyer::Resource>
Get the top 10 popular contents over the last 14 days.
-
#top_referrers(repo, options = {}) ⇒ Array<Sawyer::Resource>
Get the top 10 referrers over the last 14 days.
-
#views(repo, options = {}) ⇒ Sawyer::Resource
Get the total number of views and breakdown per day or week for the last 14 days.
Instance Method Details
#clones(repo, options = {}) ⇒ Sawyer::Resource
Get the total number of clones and breakdown per day or week for the last 14 days
62 63 64 65 |
# File 'lib/octokit/client/traffic.rb', line 62 def clones(repo, = {}) opts = ensure_api_media_type(:traffic, ) get "#{Repository.path repo}/traffic/clones", opts end |
#top_paths(repo, options = {}) ⇒ Array<Sawyer::Resource>
Get the top 10 popular contents over the last 14 days
28 29 30 31 |
# File 'lib/octokit/client/traffic.rb', line 28 def top_paths(repo, = {}) opts = ensure_api_media_type(:traffic, ) get "#{Repository.path repo}/traffic/popular/paths", opts end |
#top_referrers(repo, options = {}) ⇒ Array<Sawyer::Resource>
Get the top 10 referrers over the last 14 days
16 17 18 19 |
# File 'lib/octokit/client/traffic.rb', line 16 def top_referrers(repo, = {}) opts = ensure_api_media_type(:traffic, ) get "#{Repository.path repo}/traffic/popular/referrers", opts end |
#views(repo, options = {}) ⇒ Sawyer::Resource
Get the total number of views and breakdown per day or week for the last 14 days
45 46 47 48 |
# File 'lib/octokit/client/traffic.rb', line 45 def views(repo, = {}) opts = ensure_api_media_type(:traffic, ) get "#{Repository.path repo}/traffic/views", opts end |