module Quartz::Stateful

Direct including types

Defined in:

quartz/state.cr

Constant Summary

STATE_CHECKS = {state_complete: false}

Instance Method Summary

Macro Summary

Instance Method Detail

def initial_state #

[View source]
def initial_state=(state : Quartz::State) #

[View source]
def state #

[View source]
def state=(state : Quartz::State) #

[View source]

Macro Detail

macro def_properties #

[View source]
macro def_serialization #

[View source]
macro reset_state_checks #

[View source]
macro state(&block) #

The #state macro defines a State subclass for the current Model and expects a block to be passed.

The given block is inserted inside the definition of the State subclass.

See also State#var. See also State#parameter.

Example

class MyModel < AtomicModel
  state do
    parameter a = 0.234
    parameter b = 3.2
    var x = 0.0
    var y : Float64 { b }
  end
end

[View source]