Method: Bolide::Account#send_msg

Defined in:
lib/bolide/account.rb

#send_msg(body, qs = ".*") ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/bolide/account.rb', line 24

def send_msg(body, qs = ".*")
  return false if !qs.kind_of?(String) && !qs.kind_of?(Array)

  msg = create_msg(body, qs)
  resp = session.post('/msg.xml', msg, headers)
  p resp.body
  if resp.status > 400
    xml = Nokogiri::XML(resp.body)

    @error = xml.at_css('error')
    if(@error)
      raise @error.content
    else
      raise resp.body
    end
  end
end