Class: Bananajour::Bonjour::BananajourBrowser

Inherits:
Object
  • Object
show all
Defined in:
lib/bananajour/bonjour/bananajour_browser.rb

Instance Method Summary collapse

Constructor Details

#initializeBananajourBrowser

Returns a new instance of BananajourBrowser.



4
5
6
# File 'lib/bananajour/bonjour/bananajour_browser.rb', line 4

def initialize
  @browser = Browser.new('_http._tcp,_bananajour')
end

Instance Method Details

#bananajoursObject



8
9
10
11
12
13
14
15
16
17
# File 'lib/bananajour/bonjour/bananajour_browser.rb', line 8

def bananajours
  @browser.replies.map do |reply|
    Person.new(
      reply.text_record["name"],
      reply.text_record["email"],
      reply.text_record["uri"],
      reply.text_record["gravatar"]
    )
  end
end

#other_bananajoursObject



19
20
21
# File 'lib/bananajour/bonjour/bananajour_browser.rb', line 19

def other_bananajours
  bananajours.reject {|b| b.uri == Bananajour.web_uri}
end