Class: Txdb::Handlers::HookHandler
- Inherits:
-
Object
- Object
- Txdb::Handlers::HookHandler
- Includes:
- ResponseHelpers
- Defined in:
- lib/txdb/handlers/hook_handler.rb
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Class Method Summary collapse
Instance Method Summary collapse
- #handle ⇒ Object
-
#initialize(request) ⇒ HookHandler
constructor
A new instance of HookHandler.
Constructor Details
#initialize(request) ⇒ HookHandler
Returns a new instance of HookHandler.
17 18 19 |
# File 'lib/txdb/handlers/hook_handler.rb', line 17 def initialize(request) @request = request end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
15 16 17 |
# File 'lib/txdb/handlers/hook_handler.rb', line 15 def request @request end |
Class Method Details
.handle_request(request) ⇒ Object
8 9 10 |
# File 'lib/txdb/handlers/hook_handler.rb', line 8 def handle_request(request) new(request).handle end |
Instance Method Details
#handle ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/txdb/handlers/hook_handler.rb', line 21 def handle return respond_with_error(401, 'Unauthorized') unless authentic_request? downloader.download_resource(resource, table, locale) respond_with(200, {}) rescue => e respond_with_error(500, "Internal server error: #{e.}", e) end |