Class: Imessage::Sender

Inherits:
Object
  • Object
show all
Defined in:
lib/imessage/sender.rb

Instance Method Summary collapse

Instance Method Details

#deliver(options = { text: nil, attachment: nil, contacts: [] }) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/imessage/sender.rb', line 5

def deliver(options = { text: nil, attachment: nil, contacts: [] })
  raise 'You must specific at least a text or attachment.' if options[:text].nil? && options[:attachment].nil?

  raise 'You must specific at least one contact' if options[:contacts].empty?

  options[:contacts].each do |contact|
    _deliver(options[:text], options[:attachment], contact)
  end
end