Module: ScormEngine::Api::Endpoints::About
- Included in:
- ScormEngine::Api::Endpoints
- Defined in:
- lib/scorm_engine/api/endpoints/about.rb
Instance Method Summary collapse
-
#get_about ⇒ ScormEngine::Response
Get back the version and platform of the running instance of Engine.
-
#get_about_user_count(options = {}) ⇒ ScormEngine::Response
Gets the number of users across all tenants.
Instance Method Details
#get_about ⇒ ScormEngine::Response
Get back the version and platform of the running instance of Engine
12 13 14 15 16 17 18 |
# File 'lib/scorm_engine/api/endpoints/about.rb', line 12 def get_about response = get("about") result = OpenStruct.new(response.body) Response.new(raw_response: response, result: result) end |
#get_about_user_count(options = {}) ⇒ ScormEngine::Response
Gets the number of users across all tenants.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/scorm_engine/api/endpoints/about.rb', line 37 def get_about_user_count( = {}) response = get("about/userCount", ) result = OpenStruct.new result.total = response.body["combinedTenants"]["total"] result.dispatched = response.body["combinedTenants"]["dispatched"] result.non_dispatched = response.body["combinedTenants"]["nonDispatched"] result.by_tenant = {} response.body["byTenant"].each do |tenant| result.by_tenant[tenant["tenantName"]] = OpenStruct.new( total: tenant["total"], dispatched: tenant["dispatched"], non_dispatched: tenant["nonDispatched"] ) end Response.new(raw_response: response, result: result) end |