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.
18 19 20 |
# File 'lib/txdb/handlers/hook_handler.rb', line 18 def initialize(request) @request = request end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
16 17 18 |
# File 'lib/txdb/handlers/hook_handler.rb', line 16 def request @request end |
Class Method Details
.handle_request(request) ⇒ Object
9 10 11 |
# File 'lib/txdb/handlers/hook_handler.rb', line 9 def handle_request(request) new(request).handle end |
Instance Method Details
#handle ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/txdb/handlers/hook_handler.rb', line 22 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 |