Class: PodcastBuddy::PodSignal
- Inherits:
-
Object
- Object
- PodcastBuddy::PodSignal
- Defined in:
- lib/podcast_buddy/pod_signal.rb
Instance Method Summary collapse
-
#initialize ⇒ PodSignal
constructor
A new instance of PodSignal.
- #subscribe(&block) ⇒ Object
- #trigger(data = nil) ⇒ Object
Constructor Details
#initialize ⇒ PodSignal
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 |