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
26 27 28 29 |
# 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
14 15 16 17 |
# 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.
39 40 41 42 |
# File 'lib/octokit/client/licenses.rb', line 39 def repository_license_contents(repo, = {}) = ensure_api_media_type(:licenses, ) get "#{Repository.path repo}/license", end |