class Sus::Output::Structured
def self.buffered(...)
def self.buffered(...) Buffered.new(self.new(...)) end
def inform(message, identity)
def inform(message, identity) unless message.is_a?(String) message = message.inspect end @io.puts(JSON.generate({ inform: @identity, message: { text: message, location: identity&.to_location, } })) @io.flush end
def initialize(io, identity = nil)
def initialize(io, identity = nil) @io = io @identity = identity end
def skip(reason, identity)
def skip(reason, identity) inform(reason.to_s, identity) end