Class: Slax::Payload

Inherits:
Object
  • Object
show all
Defined in:
lib/slax/payload.rb

Instance Method Summary collapse

Constructor Details

#initialize(url, payload) ⇒ Payload

Returns a new instance of Payload.



5
6
7
8
# File 'lib/slax/payload.rb', line 5

def initialize(url, payload)
  @url = url
  @payload = payload
end

Instance Method Details

#sendObject



10
11
12
# File 'lib/slax/payload.rb', line 10

def send
  build_and_send
end

#send!Object



14
15
16
17
18
19
20
21
# File 'lib/slax/payload.rb', line 14

def send!
  response = build_and_send
  if response.code == 200
    response
  else
    raise SendError
  end
end