class
UI::ScreenContext::Native
- UI::ScreenContext::Native
- UI::ScreenContext
- Reference
- Object
Overview
Concrete ScreenContext for native targets. Wraps:
- the per-mount FormState,
- the per-app Session + Flash,
- the design tokens,
- the NavigationCoordinator (for screens that need direct access to the route stack, e.g. depth-aware back-button affordances),
- the per-button action_params payload.
Defined in:
asset_pipeline/native_context.crConstructors
Instance Method Summary
- #action_params : Hash(String, String)
-
#csrf_token : String | Nil
Native targets do not have CSRF — the form submission path is an in-process action dispatch, not an HTTP POST.
- #design_tokens : UI::DesignTokens::Tokens
- #flash : UI::Flash
-
#flash_data : Hash(String, String)
Flash messages for the current screen (snapshot for display).
- #form_state : UI::FormState
- #navigation : UI::NavigationCoordinator
-
#params : Hash(String, String)
Snapshot of the per-screen form values.
-
#params_multi : Hash(String, Array(String))
Native targets do not carry multi-value form params yet — text inputs are scalar-only.
- #session : UI::Session
Instance methods inherited from class UI::ScreenContext
csrf_token : String | Nil
csrf_token,
design_tokens : UI::DesignTokens::Tokens
design_tokens,
flash_data : Hash(String, String)
flash_data,
params : Hash(String, String)
params,
params_multi : Hash(String, Array(String))
params_multi
Constructor Detail
Instance Method Detail
Native targets do not have CSRF — the form submission path is an in-process action dispatch, not an HTTP POST. Returns nil explicitly to satisfy the abstract contract and make the absence intentional rather than accidental.
Flash messages for the current screen (snapshot for display).
Snapshot of the per-screen form values. Implements the abstract
UI::ScreenContext#params contract for native targets. Always
reads via form_state.to_h (which returns a defensive copy in
iter 3); does NOT silently merge #action_params.
Native targets do not carry multi-value form params yet — text inputs are scalar-only. Returns an empty Hash to satisfy the abstract contract. Future multi-select widgets (e.g. checkbox groups) will populate this.