Class: ChefLicensing::Api::ListLicenses
- Inherits:
-
Object
- Object
- ChefLicensing::Api::ListLicenses
- Defined in:
- lib/chef-licensing/api/list_licenses.rb
Class Method Summary collapse
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(opts = {}) ⇒ ListLicenses
constructor
A new instance of ListLicenses.
Constructor Details
#initialize(opts = {}) ⇒ ListLicenses
Returns a new instance of ListLicenses.
14 15 16 |
# File 'lib/chef-licensing/api/list_licenses.rb', line 14 def initialize(opts = {}) @restful_client = opts[:restful_client] ? opts[:restful_client].new : ChefLicensing::RestfulClient::V1.new end |
Class Method Details
.info(opts = {}) ⇒ Object
9 10 11 |
# File 'lib/chef-licensing/api/list_licenses.rb', line 9 def info(opts = {}) new(opts).info end |
Instance Method Details
#info ⇒ Object
18 19 20 21 22 23 |
# File 'lib/chef-licensing/api/list_licenses.rb', line 18 def info response = restful_client.list_licenses raise ChefLicensing::ListLicensesError.new(response., response.status_code) unless response.status_code == 200 && response.data response.data end |