Class: Banacle::Handler
- Inherits:
-
Object
- Object
- Banacle::Handler
- Defined in:
- lib/banacle/handler.rb
Direct Known Subclasses
Defined Under Namespace
Classes: InvalidAuthenticatorError
Instance Attribute Summary collapse
-
#auth ⇒ Object
readonly
Returns the value of attribute auth.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
Instance Attribute Details
#auth ⇒ Object (readonly)
Returns the value of attribute auth.
8 9 10 |
# File 'lib/banacle/handler.rb', line 8 def auth @auth end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
8 9 10 |
# File 'lib/banacle/handler.rb', line 8 def request @request end |
Instance Method Details
#handle(request) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/banacle/handler.rb', line 10 def handle(request) @request = request unless skip_validation? || SlackValidator.valid_signature?(request) return [401, {}, "invalid request"] end handle_request end |
#handle_request ⇒ Object
override
21 22 |
# File 'lib/banacle/handler.rb', line 21 def handle_request end |
#set_authenticator!(auth) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/banacle/handler.rb', line 24 def set_authenticator!(auth) unless auth.is_a?(Banacle::Authenticator) raise InvalidAuthenticatorError.new(auth.inspect) end @auth = auth end |