Sha256: 2ede20c7ed3b16f3a1d768c59c00efc29a5b433c29c5db573f6563ae25ee21a7

Contents?: true

Size: 406 Bytes

Versions: 8

Compression:

Stored size: 406 Bytes

Contents

# frozen_string_literal: true

# Released under the MIT License.
# Copyright, 2019-2024, by Samuel Williams.

module Console
	module Event
		class Generic
			def as_json(...)
				to_hash
			end
			
			def to_json(...)
				JSON.generate(as_json, ...)
			end
			
			def to_s
				to_json
			end
			
			def emit(*arguments, **options)
				Console.call(*arguments, event: self, **options)
			end
		end
	end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
console-1.29.0 lib/console/event/generic.rb
console-1.28.1 lib/console/event/generic.rb
console-1.28.0 lib/console/event/generic.rb
console-1.27.0 lib/console/event/generic.rb
console-1.26.0 lib/console/event/generic.rb
console-1.25.2 lib/console/event/generic.rb
console-1.25.1 lib/console/event/generic.rb
console-1.25.0 lib/console/event/generic.rb