Class: Avo::Licensing::LicenseManager

Inherits:
Object
  • Object
show all
Defined in:
lib/avo/licensing/license_manager.rb

Class Method Summary collapse

Instance Method Summary collapse

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

#licenseObject



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