Class: PodcastBuddy::PodSignal

Inherits:
Object
  • Object
show all
Defined in:
lib/podcast_buddy/pod_signal.rb

Instance Method Summary collapse

Constructor Details

#initializePodSignal

Returns a new instance of PodSignal.



5
6
7
8
9
# File 'lib/podcast_buddy/pod_signal.rb', line 5

def initialize
  @listeners = []
  @queue = Queue.new
  start_listener_thread
end

Instance Method Details

#subscribe(&block) ⇒ Object



11
12
13
# File 'lib/podcast_buddy/pod_signal.rb', line 11

def subscribe(&block)
  @listeners << block
end

#trigger(data = nil) ⇒ Object



15
16
17
# File 'lib/podcast_buddy/pod_signal.rb', line 15

def trigger(data = nil)
  @queue << data
end