class Cucumber::WireSupport::WirePacket
a message and a hash of arguments
Represents the packet of data sent over the wire as JSON data, containing
def handle_with(handler)
def handle_with(handler) handler.send("handle_#{@message}", @params) end
def initialize(message, params = nil)
def initialize(message, params = nil) @message, @params = message, params end
def parse(raw)
def parse(raw) attributes = JSON.parse(raw.strip) message = attributes[0] params = attributes[1] new(message, params) end
def to_json
def to_json packet = [@message] packet << @params if @params packet.to_json end