Class: Avo::Licensing::LicenseManager
- Inherits:
-
Object
- Object
- Avo::Licensing::LicenseManager
- Defined in:
- lib/avo/licensing/license_manager.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hq_response) ⇒ LicenseManager
constructor
A new instance of LicenseManager.
- #license ⇒ Object
Constructor Details
#initialize(hq_response) ⇒ LicenseManager
Returns a new instance of LicenseManager.
4 5 6 |
# File 'lib/avo/licensing/license_manager.rb', line 4 def initialize(hq_response) @hq_response = hq_response end |
Class Method Details
.refresh_license(request) ⇒ Object
19 20 21 |
# File 'lib/avo/licensing/license_manager.rb', line 19 def self.refresh_license(request) new(Licensing::HQ.new(request).fresh_response).license end |
Instance Method Details
#license ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/avo/licensing/license_manager.rb', line 8 def license case @hq_response["id"] when "community" CommunityLicense.new @hq_response when "pro", "advanced" ProLicense.new @hq_response else NilLicense.new @hq_response end end |