Module: Ruff::Standard::State
- Defined in:
- lib/ruff/standard/state.rb
Overview
State
provides effects State.get
and State.modify
,
and the implementation of the mutable cell or so-called state .
The module has an instance of Instance
and provides its methods as module method.
Defined Under Namespace
Classes: Instance
Instance Attribute Summary collapse
- #eff ⇒ Object readonly
Class Method Summary collapse
- .get ⇒ Object
- .modify(&fn) ⇒ Object
- .put(s) ⇒ Object
- .with(&task) ⇒ Object
- .with_init(init, &task) ⇒ Object
Instance Attribute Details
#eff ⇒ Object (readonly)
136 137 138 |
# File 'lib/ruff/standard/state.rb', line 136 def eff @eff end |
Class Method Details
.get ⇒ Object
109 110 111 |
# File 'lib/ruff/standard/state.rb', line 109 def get @inst.get end |
.modify(&fn) ⇒ Object
114 115 116 |
# File 'lib/ruff/standard/state.rb', line 114 def modify(&fn) @inst.modify(&fn) end |
.put(s) ⇒ Object
119 120 121 |
# File 'lib/ruff/standard/state.rb', line 119 def put(s) @inst.put s end |
.with(&task) ⇒ Object
129 130 131 |
# File 'lib/ruff/standard/state.rb', line 129 def with(&task) @inst.with(&task) end |
.with_init(init, &task) ⇒ Object
124 125 126 |
# File 'lib/ruff/standard/state.rb', line 124 def with_init(init, &task) @inst.with_init init, &task end |