class Console::Event::Generic

A generic event which can be used to represent structured data.

def as_json(...)

@returns [Hash] The hash representation of the event.

Convert the event to a hash suitable for JSON serialization.
def as_json(...)
	to_hash
end

def emit(*arguments, **options)

@parameter options [Hash] Additional options to pass to the logger output.
@parameter arguments [Array] The arguments to log.

Log the event using the given output interface.
def emit(*arguments, **options)
	Console.call(*arguments, event: self, **options)
end

def to_hash

@returns [Hash] The hash representation of the event.

Convert the event to a hash suitable for JSON serialization.
def to_hash
	{}
end

def to_json(...)

@returns [String] The JSON representation of the event.

Serialize the event to JSON.
def to_json(...)
	JSON.generate(as_json, ...)
end

def to_s

@returns [String] The string representation of the event.

Convert the event to a string (JSON).
def to_s
	to_json
end