Class: Holoserve::State::Updater
- Inherits:
-
Object
- Object
- Holoserve::State::Updater
- Defined in:
- lib/holoserve/state/updater.rb
Instance Method Summary collapse
-
#initialize(state, transitions) ⇒ Updater
constructor
A new instance of Updater.
- #perform ⇒ Object
Constructor Details
#initialize(state, transitions) ⇒ Updater
Returns a new instance of Updater.
4 5 6 |
# File 'lib/holoserve/state/updater.rb', line 4 def initialize(state, transitions) @state, @transitions = state, transitions end |
Instance Method Details
#perform ⇒ Object
8 9 10 11 12 |
# File 'lib/holoserve/state/updater.rb', line 8 def perform (@transitions || { }).each do |resource, value| @state[resource] = value end end |