Class: Physicist::Laboratory::ScientistUpdatedEventListener

Inherits:
Metacosm::EventListener
  • Object
show all
Defined in:
lib/physicist/laboratory/listeners/scientist_updated_event_listener.rb

Instance Method Summary collapse

Instance Method Details

#receive(scientist_id:, position:, velocity:, updated_at:) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/physicist/laboratory/listeners/scientist_updated_event_listener.rb', line 4

def receive(scientist_id:, position:, velocity:, updated_at:)
  scientist_view = ScientistView.find_by(scientist_id: scientist_id)
  scientist_view.update(
    position: position,
    velocity: velocity,
    t0: updated_at
  )
end