Class: GitHooks::Notifier::JabberClient::Buddy

Inherits:
Object
  • Object
show all
Defined in:
lib/git_hooks/notifier/jabber_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(jid, roster_reference) ⇒ Buddy

Returns a new instance of Buddy.



12
13
14
15
# File 'lib/git_hooks/notifier/jabber_client.rb', line 12

def initialize(jid, roster_reference)
  @jid = Jabber::JID.new(jid)
  @roster = roster_reference
end

Instance Attribute Details

#jidObject (readonly)

Returns the value of attribute jid.



10
11
12
# File 'lib/git_hooks/notifier/jabber_client.rb', line 10

def jid
  @jid
end

Instance Method Details

#subscribed?Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
# File 'lib/git_hooks/notifier/jabber_client.rb', line 17

def subscribed?
  roster_item = @roster[jid]
  if roster_item
    return roster_item.subscription == :both ? true : false
  end
end