Module: Octokit::Client::Licenses
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/client/licenses.rb |
Overview
Methods for licenses API
Instance Method Summary
-
#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
# File 'lib/octokit/client/licenses.rb', line 26
def license(license_name, = {}) = ensure_api_media_type(:licenses, ) get "licenses/#{license_name}", end
#licenses(options = {}) ⇒ Array
<Sawyer::Resource
>
List all licenses
# File 'lib/octokit/client/licenses.rb', line 14
def licenses( = {}) = ensure_api_media_type(:licenses, ) paginate 'licenses', end
#repository_license_contents(repo, options = {}) ⇒ Sawyer::Resource
Returns the contents of the repository’s license file, if one is detected.
# File 'lib/octokit/client/licenses.rb', line 39
def repository_license_contents(repo, = {}) = ensure_api_media_type(:licenses, ) get "#{Repository.path repo}/license", end