Class: Api::HandlerBundlesInit

Inherits:
HandlerBase show all
Defined in:
lib/mrpin/api/bundles/init/handler_bundles_init.rb

Instance Attribute Summary

Attributes inherited from HandlerBase

#handle_duration_max, #handle_duration_min, #handle_duration_total, #requests_count

Instance Method Summary collapse

Methods inherited from HandlerBase

#before_handle, #post_handle, #reset_handler_stats

Constructor Details

#initialize(options = nil) ⇒ HandlerBundlesInit

default constructor



13
14
15
16
17
# File 'lib/mrpin/api/bundles/init/handler_bundles_init.rb', line 13

def initialize(options = nil)
  super(options)

  @managers_bundles_map = AppInfo.instance.managers_bundles_map
end

Instance Method Details

#handle_request(session, request) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/mrpin/api/bundles/init/handler_bundles_init.rb', line 19

def handle_request(session, request)
  super

  response = ResponseBundlesInit.new(request.request_id)

  manager_bundles = @managers_bundles_map[request.build_type]

  if manager_bundles.nil?
    response.url_data = nil
  else
    response.url_data = manager_bundles.url_client_data
  end

  session.send_response(response)
end