Module: RubstApi
- Defined in:
- lib/rubst_api.rb,
lib/rubst_api/app.rb,
lib/rubst_api/sse.rb,
lib/rubst_api/http.rb,
lib/rubst_api/model.rb,
lib/rubst_api/errors.rb,
lib/rubst_api/params.rb,
lib/rubst_api/status.rb,
lib/rubst_api/openapi.rb,
lib/rubst_api/routing.rb,
lib/rubst_api/version.rb,
lib/rubst_api/security.rb,
lib/rubst_api/responses.rb,
lib/rubst_api/websocket.rb,
lib/rubst_api/middleware.rb,
lib/rubst_api/test_client.rb,
lib/rubst_api/dependencies.rb,
lib/rubst_api/static_files.rb,
lib/rubst_api/background_tasks.rb
Defined Under Namespace
Modules: Middleware, OpenAPI, Schema, Security, Serializer, Status, Validator
Classes: APIRouter, App, BackgroundTask, BackgroundTasks, Dependency, DependencyResolver, EventSourceResponse, FileResponse, HTMLResponse, HTTPException, Headers, JSONResponse, Model, Param, PlainTextResponse, RedirectResponse, Request, RequestValidationError, Response, ResponseValidationError, Route, SecurityDependency, ServerSentEvent, StaticFiles, StreamingResponse, TestClient, TestResponse, UploadFile, ValidationError, WebSocket, WebSocketException
Constant Summary
collapse
- UNDEFINED =
Object.new.freeze
- VERSION =
"0.1.1"
- ORJSONResponse =
JSONResponse
- UJSONResponse =
JSONResponse
Class Method Summary
collapse
Class Method Details
.Body ⇒ Object
28
|
# File 'lib/rubst_api.rb', line 28
def Body(type = Hash, **options) = Param.new(:body, type:, **options)
|
.Cookie ⇒ Object
27
|
# File 'lib/rubst_api.rb', line 27
def Cookie(type = String, **options) = Param.new(:cookie, type:, **options)
|
.Depends ⇒ Object
31
|
# File 'lib/rubst_api.rb', line 31
def Depends(callable = nil, **options, &block) = Dependency.new(callable || block, **options)
|
.File ⇒ Object
30
|
# File 'lib/rubst_api.rb', line 30
def File(**options) = Param.new(:file, type: UploadFile, **options)
|
29
|
# File 'lib/rubst_api.rb', line 29
def Form(type = String, **options) = Param.new(:form, type:, **options)
|
26
|
# File 'lib/rubst_api.rb', line 26
def Header(type = String, **options) = Param.new(:header, type:, **options)
|
.jsonable_encoder(value) ⇒ Object
36
37
38
|
# File 'lib/rubst_api.rb', line 36
def jsonable_encoder(value, **)
Serializer.dump(value)
end
|
.Path ⇒ Object
25
|
# File 'lib/rubst_api.rb', line 25
def Path(type = String, **options) = Param.new(:path, type:, required: true, **options)
|
.Query ⇒ Object
24
|
# File 'lib/rubst_api.rb', line 24
def Query(type = String, **options) = Param.new(:query, type:, **options)
|
.Security ⇒ Object
32
33
34
|
# File 'lib/rubst_api.rb', line 32
def Security(callable = nil, scopes: [], **options, &block)
SecurityDependency.new(callable || block, scopes:, **options)
end
|