Class: Imessage::Sender
- Inherits:
-
Object
- Object
- Imessage::Sender
- Defined in:
- lib/imessage/sender.rb
Instance Method Summary collapse
Instance Method Details
#deliver(options = {text:nil, attachment:nil, contacts: []}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/imessage/sender.rb', line 3 def deliver( = {text:nil, attachment:nil, contacts: []}) if [:text].nil? && [:attachment].nil? raise "You must specific at least a text or attachment." end if [:contacts].empty? raise "You must specific at least one contact" end [:contacts].each do |contact| _deliver([:text], [:attachment], contact) end end |