Class: BlabberMouth::Adapters::Xmpp
- Includes:
- Jabber
- Defined in:
- lib/blabber_mouth/adapters/xmpp_msg.rb
Overview
All mail adapters need to extend this class.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#convert ⇒ Object
Convert the BlabberMouth object to the adapted object.
-
#deliverable ⇒ Object
The RAW encoded String ready for delivery via SMTP, Sendmail, etc…
-
#transformed ⇒ Object
The transformed (ie, converted, object).
Methods inherited from Base
Constructor Details
This class inherits a constructor from BlabberMouth::Adapters::Base
Instance Method Details
#convert ⇒ Object
Convert the BlabberMouth object to the adapted object.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/blabber_mouth/adapters/xmpp_msg.rb', line 29 def convert settings = configatron.blabber_mouth.xmpp_settings arr = [bm_notifier.to].flatten @xmpp_container = XmppMsgContainer.new @xmpp_container.recipients = arr arr.each do |rcpt| xmpp_msg = Message::new xmpp_msg.set_type(:normal) xmpp_msg.set_to(rcpt) xmpp_msg.set_from(bm_notifier.from) xmpp_msg.set_subject(bm_notifier.subject) xmpp_msg.set_type(settings.) unless bm_notifier.body(:plain).blank? xmpp_msg.set_body(bm_notifier.body(:plain)) end @xmpp_container. << xmpp_msg end return @xmpp_container end |
#deliverable ⇒ Object
The RAW encoded String ready for delivery via SMTP, Sendmail, etc…
53 54 55 |
# File 'lib/blabber_mouth/adapters/xmpp_msg.rb', line 53 def deliverable return @xmpp_container end |
#transformed ⇒ Object
The transformed (ie, converted, object)
23 24 25 26 |
# File 'lib/blabber_mouth/adapters/xmpp_msg.rb', line 23 def transformed raise BlabberMouth::Errors::UnconvertedNotifier.new if @xmpp_msg.nil? return @xmpp_container end |