Class: Switchboard::Client
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#roster ⇒ Object
readonly
Returns the value of attribute roster.
Attributes inherited from Core
Instance Method Summary collapse
-
#initialize(settings = Switchboard::Settings.new, spin = true) ⇒ Client
constructor
A new instance of Client.
Methods inherited from Core
#defer, hook, #hook, #plug!, #ready?, #run!
Constructor Details
#initialize(settings = Switchboard::Settings.new, spin = true) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/switchboard/client.rb', line 5 def initialize(settings = Switchboard::Settings.new, spin = true) super(settings, spin) # TODO jid may already have a resource, so account for that @client = Jabber::Client.new([settings["jid"], settings["resource"]] * "/") on_stream_connected do register_roster_callbacks # tell others that we're online presence defer :roster_loaded do # wait for the roster to load roster.wait_for_roster # roster has now been loaded on(:roster_loaded) end end end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
3 4 5 |
# File 'lib/switchboard/client.rb', line 3 def client @client end |
#roster ⇒ Object (readonly)
Returns the value of attribute roster.
3 4 5 |
# File 'lib/switchboard/client.rb', line 3 def roster @roster end |