Module: Octokit::Client::Licenses
- Included in:
- Octokit::Client
- Defined in:
- lib/octokit/client/licenses.rb
Overview
Methods for licenses API
Instance Method Summary collapse
-
#license(license_name, options = {}) ⇒ Sawyer::Resource
List an individual license.
-
#licenses(options = {}) ⇒ Array<Sawyer::Resource>
List all licenses.
-
#repository_license_contents(repo, options = {}) ⇒ Sawyer::Resource
Returns the contents of the repository’s license file, if one is detected.
Instance Method Details
#license(license_name, options = {}) ⇒ Sawyer::Resource
List an individual license
25 26 27 |
# File 'lib/octokit/client/licenses.rb', line 25 def license(license_name, = {}) get "licenses/#{license_name}", end |
#licenses(options = {}) ⇒ Array<Sawyer::Resource>
List all licenses
14 15 16 |
# File 'lib/octokit/client/licenses.rb', line 14 def licenses( = {}) paginate 'licenses', end |
#repository_license_contents(repo, options = {}) ⇒ Sawyer::Resource
Returns the contents of the repository’s license file, if one is detected.
37 38 39 |
# File 'lib/octokit/client/licenses.rb', line 37 def repository_license_contents(repo, = {}) get "#{Repository.path repo}/license", end |