Class: Domodoro::Channel

Inherits:
EM::Channel
  • Object
show all
Defined in:
lib/domodoro/channel.rb

Instance Method Summary collapse

Instance Method Details

#broadcast(timestamp, schedule) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/domodoro/channel.rb', line 3

def broadcast(timestamp, schedule)
  action = schedule.to_hash[timestamp]
  if action
    next_action = schedule.action_after(timestamp)
    self << {
      :current_action => [timestamp, action],
      :next_action => next_action
    }
  end
end