Class: Slax::Payload
- Inherits:
-
Object
- Object
- Slax::Payload
- Defined in:
- lib/slax/payload.rb
Instance Method Summary collapse
-
#initialize(url, payload) ⇒ Payload
constructor
A new instance of Payload.
- #send ⇒ Object
- #send! ⇒ Object
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
#send ⇒ Object
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 |