Class: Mack::Notifier::Adapters::Xmpp
- Includes:
- Jabber
- Defined in:
- lib/mack-notifier/adapters/xmpp_msg.rb
Overview
All mail adapters need to extend this class.
Constant Summary
Constants included from Jabber
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#convert ⇒ Object
Convert the Mack::Notifier 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 included from Jabber
debug, debug=, debuglog, logger, logger=
Methods inherited from Base
Constructor Details
This class inherits a constructor from Mack::Notifier::Adapters::Base
Instance Method Details
#convert ⇒ Object
Convert the Mack::Notifier object to the adapted object.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mack-notifier/adapters/xmpp_msg.rb', line 30 def convert settings = configatron.mack.notifier.xmpp_settings arr = [mack_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(mack_notifier.from) xmpp_msg.set_subject(mack_notifier.subject) xmpp_msg.set_type(settings.) unless mack_notifier.body(:plain).blank? xmpp_msg.set_body(mack_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…
54 55 56 |
# File 'lib/mack-notifier/adapters/xmpp_msg.rb', line 54 def deliverable return @xmpp_container end |
#transformed ⇒ Object
The transformed (ie, converted, object)
24 25 26 27 |
# File 'lib/mack-notifier/adapters/xmpp_msg.rb', line 24 def transformed raise Mack::Errors::UnconvertedNotifier.new if @xmpp_msg.nil? return @xmpp_container end |