Class: Upman::Extensions::GetInstallHistory::Servlet
- Inherits:
-
Server::BaseServlet
- Object
- WEBrick::HTTPServlet::AbstractServlet
- Server::BaseServlet
- Upman::Extensions::GetInstallHistory::Servlet
- Defined in:
- lib/upman/extensions/get_install_history.rb
Overview
Servlet action for WEBrick
Instance Attribute Summary collapse
-
#param_since ⇒ Object
Returns the value of attribute param_since.
Attributes inherited from Server::BaseServlet
Instance Method Summary collapse
-
#do_GET(request, response) ⇒ Object
rubocop:disable Naming/MethodName.
- #perform_action ⇒ Object
Methods inherited from Server::BaseServlet
#bad_request, #get_param, #initialize, #is_authenticated, #not_authorized, #ok
Methods included from Utils::Helper
Constructor Details
This class inherits a constructor from Upman::Server::BaseServlet
Instance Attribute Details
#param_since ⇒ Object
Returns the value of attribute param_since.
18 19 20 |
# File 'lib/upman/extensions/get_install_history.rb', line 18 def param_since @param_since end |
Instance Method Details
#do_GET(request, response) ⇒ Object
rubocop:disable Naming/MethodName
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/upman/extensions/get_install_history.rb', line 21 def do_GET(request, response) # rubocop:enable Naming/MethodName super(request, response) unless is_authenticated(request) response = (response, "Request declined") return response end unless (@param_since = get_param('since', 'date', false)) return nil end if (body = perform_action) response = ok(response, body) end end |
#perform_action ⇒ Object
40 41 42 43 |
# File 'lib/upman/extensions/get_install_history.rb', line 40 def perform_action install_history_service = ::Upman::Service::InstallHistory.new install_history_service.get(@param_since).to_json end |