Class: Bananajour::Bonjour::Browser
- Inherits:
-
Object
- Object
- Bananajour::Bonjour::Browser
- Defined in:
- lib/bananajour/bonjour/browser.rb
Overview
Generic bonjour browser
Example use:
browser = BonjourBrowser.new("_git._tcp,_bananajour")
loop do
sleep(1)
pp browser.replies.map {|r| r.name}
end
Probably gem-worthy
Instance Method Summary collapse
-
#initialize(service) ⇒ Browser
constructor
A new instance of Browser.
- #replies ⇒ Object
Constructor Details
#initialize(service) ⇒ Browser
Returns a new instance of Browser.
20 21 22 23 24 25 |
# File 'lib/bananajour/bonjour/browser.rb', line 20 def initialize(service) @service = service @mutex = Mutex.new @replies = {} watch! end |
Instance Method Details
#replies ⇒ Object
26 27 28 |
# File 'lib/bananajour/bonjour/browser.rb', line 26 def replies @mutex.synchronize { @replies.values } end |