Class: Holoserve::State::Updater

Inherits:
Object
  • Object
show all
Defined in:
lib/holoserve/state/updater.rb

Instance Method Summary collapse

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

#performObject



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