Class: ChefLicensing::Context::State
- Inherits:
-
Object
- Object
- ChefLicensing::Context::State
- Defined in:
- lib/chef-licensing/context.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#license ⇒ Object
Get license context in local or global state.
-
#license=(license) ⇒ Object
Set license context in local or global state.
- #license_keys ⇒ Object abstract
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
88 89 90 |
# File 'lib/chef-licensing/context.rb', line 88 def context @context end |
#options ⇒ Object
Returns the value of attribute options.
88 89 90 |
# File 'lib/chef-licensing/context.rb', line 88 def @options end |
Instance Method Details
#license ⇒ Object
Get license context in local or global state
96 97 98 99 100 101 102 |
# File 'lib/chef-licensing/context.rb', line 96 def license if license_keys.empty? @license ||= nil else @license ||= ChefLicensing.client(license_keys: license_keys) end end |
#license=(license) ⇒ Object
Set license context in local or global state
105 106 107 |
# File 'lib/chef-licensing/context.rb', line 105 def license=(license) @license ||= license end |
#license_keys ⇒ Object
This method is abstract.
91 92 93 |
# File 'lib/chef-licensing/context.rb', line 91 def license_keys raise NotImplementedError, "#{self.class} has not implemented method '#{__method__}'" end |