Class: Saber::AutoFetcher::Client
- Inherits:
-
Object
- Object
- Saber::AutoFetcher::Client
- Includes:
- Blather::DSL
- Defined in:
- lib/saber/autofetcher/client.rb
Instance Attribute Summary collapse
-
#fetcher ⇒ Object
readonly
Returns the value of attribute fetcher.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #run ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
Instance Attribute Details
#fetcher ⇒ Object (readonly)
Returns the value of attribute fetcher.
18 19 20 |
# File 'lib/saber/autofetcher/client.rb', line 18 def fetcher @fetcher end |
Class Method Details
Instance Method Details
#run ⇒ Object
24 25 26 |
# File 'lib/saber/autofetcher/client.rb', line 24 def run client.run end |
#start ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/saber/autofetcher/client.rb', line 28 def start rc = Rc.client.xmpp setup rc.jid, rc.password, rc.host, rc.port when_ready { Saber.ui.say ">> Connected to xmpp at #{jid}" } disconnected { client.connect } :chat?, :body, :from => /#{Rc.server.xmpp.jid}/ do |m| process_msg m.body end end |
#stop ⇒ Object
39 40 41 |
# File 'lib/saber/autofetcher/client.rb', line 39 def stop @client.close! end |