Module: Jackal::Utils::Payload
- Included in:
- Carnivore::Http::PointBuilder::Endpoint, Callback, Callback, Jackal::Utils
- Defined in:
- lib/jackal/utils/payload.rb
Overview
Payload helper utilities
Instance Method Summary (collapse)
-
- (Smash) new_payload(name, payload, *args)
Generate a new payload.
-
- (Smash) unpack(message)
Extract payload from message.
Instance Method Details
- (Smash) new_payload(name, payload, *args)
Generate a new payload
15 16 17 18 19 20 21 |
# File 'lib/jackal/utils/payload.rb', line 15 def new_payload(name, payload, *args) Smash.new( :name => name, :id => Celluloid.uuid, :data => payload ) end |
- (Smash) unpack(message)
Extract payload from message
27 28 29 30 |
# File 'lib/jackal/utils/payload.rb', line 27 def unpack() msg = [:message].to_smash msg.fetch(:payload, msg) end |