Class: Whoosh::Endpoint
- Inherits:
-
Object
- Object
- Whoosh::Endpoint
- Includes:
- Streaming::Helpers
- Defined in:
- lib/whoosh/endpoint.rb
Defined Under Namespace
Classes: Context
Class Method Summary collapse
- .declared_routes ⇒ Object
- .delete(path, **opts) ⇒ Object
- .dependencies ⇒ Object
- .get(path, **opts) ⇒ Object
- .inherited(subclass) ⇒ Object
- .inject(*names) ⇒ Object
- .options(path, **opts) ⇒ Object
- .patch(path, **opts) ⇒ Object
- .post(path, **opts) ⇒ Object
- .put(path, **opts) ⇒ Object
Instance Method Summary collapse
Methods included from Streaming::Helpers
Class Method Details
.declared_routes ⇒ Object
36 37 38 |
# File 'lib/whoosh/endpoint.rb', line 36 def declared_routes @declared_routes end |
.delete(path, **opts) ⇒ Object
64 65 66 |
# File 'lib/whoosh/endpoint.rb', line 64 def delete(path, **opts) declare_route("DELETE", path, **opts) end |
.dependencies ⇒ Object
44 45 46 |
# File 'lib/whoosh/endpoint.rb', line 44 def dependencies @dependencies || [] end |
.get(path, **opts) ⇒ Object
48 49 50 |
# File 'lib/whoosh/endpoint.rb', line 48 def get(path, **opts) declare_route("GET", path, **opts) end |
.inherited(subclass) ⇒ Object
31 32 33 34 |
# File 'lib/whoosh/endpoint.rb', line 31 def inherited(subclass) super subclass.instance_variable_set(:@declared_routes, []) end |
.inject(*names) ⇒ Object
40 41 42 |
# File 'lib/whoosh/endpoint.rb', line 40 def inject(*names) @dependencies = names end |
.options(path, **opts) ⇒ Object
68 69 70 |
# File 'lib/whoosh/endpoint.rb', line 68 def (path, **opts) declare_route("OPTIONS", path, **opts) end |
.patch(path, **opts) ⇒ Object
60 61 62 |
# File 'lib/whoosh/endpoint.rb', line 60 def patch(path, **opts) declare_route("PATCH", path, **opts) end |
.post(path, **opts) ⇒ Object
52 53 54 |
# File 'lib/whoosh/endpoint.rb', line 52 def post(path, **opts) declare_route("POST", path, **opts) end |
.put(path, **opts) ⇒ Object
56 57 58 |
# File 'lib/whoosh/endpoint.rb', line 56 def put(path, **opts) declare_route("PUT", path, **opts) end |
Instance Method Details
#call(req) ⇒ Object
85 86 87 |
# File 'lib/whoosh/endpoint.rb', line 85 def call(req) raise NotImplementedError, "#{self.class}#call must be implemented" end |