Module: Inertia
- Defined in:
- lib/inertia/props.rb,
lib/inertia/rspec.rb,
lib/inertia/inertia.rb,
lib/inertia/version.rb,
lib/inertia/frontend.rb,
lib/inertia/renderer.rb,
lib/inertia/configuration.rb,
lib/inertia/rage_extension.rb,
lib/inertia/request_context.rb,
lib/inertia/vite_dev_server.rb,
lib/inertia/protocol_builder.rb,
lib/inertia/middleware/assets.rb,
lib/inertia/controller_helpers.rb,
lib/inertia/middleware/version.rb,
lib/inertia/_codex_protocol_builder.rb
Defined Under Namespace
Modules: ControllerHelpers, Middleware, Props, RSpec Classes: Configuration, Frontend, ProtocolBuilder, RageExtension, Renderer, RequestContext, ViteDevServer
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
-
.config ⇒ Configuration
Returns the global configuration instance.
-
.configure { ... } ⇒ Object
Configures the Inertia integration using a block.
-
.deferred(group: "default") { ... } ⇒ Props::Deferred
Creates a deferred prop that will be loaded in a subsequent request after the initial page load.
-
.once(key: nil, fresh: false, expires_in: nil) { ... } ⇒ Props::Once
Creates a prop that is evaluated only once and cached by the frontend.
-
.optional { ... } ⇒ Props::Optional
Creates a prop that is only included when explicitly requested by the client.
Class Method Details
.config ⇒ Configuration
Returns the global configuration instance.
39 40 41 |
# File 'lib/inertia/inertia.rb', line 39 def self.config @config ||= Configuration.new end |
.configure { ... } ⇒ Object
Configures the Inertia integration using a block.
The block is evaluated in the context of the Configuration instance, allowing direct access to configuration setters.
32 33 34 |
# File 'lib/inertia/inertia.rb', line 32 def self.configure yield config end |
.deferred(group: "default") { ... } ⇒ Props::Deferred
Creates a deferred prop that will be loaded in a subsequent request after the initial page load.
52 53 54 |
# File 'lib/inertia/inertia.rb', line 52 def self.deferred(group: "default", &block) Props::Deferred.new(group:, block:) end |
.once(key: nil, fresh: false, expires_in: nil) { ... } ⇒ Props::Once
Creates a prop that is evaluated only once and cached by the frontend.
67 68 69 |
# File 'lib/inertia/inertia.rb', line 67 def self.once(key: nil, fresh: false, expires_in: nil, &block) Props::Once.new(key:, fresh:, expires_in:, block:) end |
.optional { ... } ⇒ Props::Optional
Creates a prop that is only included when explicitly requested by the client.
80 81 82 |
# File 'lib/inertia/inertia.rb', line 80 def self.optional(&block) Props::Optional.new(block:) end |