Class: Whoosh::Endpoint
- Inherits:
-
Object
- Object
- Whoosh::Endpoint
- 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
Class Method Details
.declared_routes ⇒ Object
34 35 36 |
# File 'lib/whoosh/endpoint.rb', line 34 def declared_routes @declared_routes end |
.delete(path, **opts) ⇒ Object
62 63 64 |
# File 'lib/whoosh/endpoint.rb', line 62 def delete(path, **opts) declare_route("DELETE", path, **opts) end |
.dependencies ⇒ Object
42 43 44 |
# File 'lib/whoosh/endpoint.rb', line 42 def dependencies @dependencies || [] end |
.get(path, **opts) ⇒ Object
46 47 48 |
# File 'lib/whoosh/endpoint.rb', line 46 def get(path, **opts) declare_route("GET", path, **opts) end |
.inherited(subclass) ⇒ Object
29 30 31 32 |
# File 'lib/whoosh/endpoint.rb', line 29 def inherited(subclass) super subclass.instance_variable_set(:@declared_routes, []) end |
.inject(*names) ⇒ Object
38 39 40 |
# File 'lib/whoosh/endpoint.rb', line 38 def inject(*names) @dependencies = names end |
.options(path, **opts) ⇒ Object
66 67 68 |
# File 'lib/whoosh/endpoint.rb', line 66 def (path, **opts) declare_route("OPTIONS", path, **opts) end |
.patch(path, **opts) ⇒ Object
58 59 60 |
# File 'lib/whoosh/endpoint.rb', line 58 def patch(path, **opts) declare_route("PATCH", path, **opts) end |
.post(path, **opts) ⇒ Object
50 51 52 |
# File 'lib/whoosh/endpoint.rb', line 50 def post(path, **opts) declare_route("POST", path, **opts) end |
.put(path, **opts) ⇒ Object
54 55 56 |
# File 'lib/whoosh/endpoint.rb', line 54 def put(path, **opts) declare_route("PUT", path, **opts) end |
Instance Method Details
#call(req) ⇒ Object
83 84 85 |
# File 'lib/whoosh/endpoint.rb', line 83 def call(req) raise NotImplementedError, "#{self.class}#call must be implemented" end |