Class: Notifu::Actors::GammuSmsBridge
- Inherits:
-
Notifu::Actor
- Object
- Notifu::Actor
- Notifu::Actors::GammuSmsBridge
- Defined in:
- lib/notifu/actors/gammu_sms_bridge.rb
Instance Attribute Summary
Attributes inherited from Notifu::Actor
Instance Method Summary collapse
Methods inherited from Notifu::Actor
#apply_template, #default_template, #load_data, #perform
Methods included from Util
Instance Method Details
#act ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/notifu/actors/gammu_sms_bridge.rb', line 9 def act self.contacts.each do |contact| cell = contact.cell tmpl = contact.sms_template tmpl ||= default_template = self.apply_template tmpl # send message to sms-bridge socket = TCPSocket.new Notifu::CONFIG[:actors][:gammu_sms_bridge][:host], Notifu::CONFIG[:actors][:gammu_sms_bridge][port] socket.send contact.cell.to_s + "--" + socket.close socket = nil end end |