Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of Ruby's dynamicism
# https://twitter.com/josh_cheek/status/1583584074652082176
def
( class
class A
self
end::B < class C; self end
self
end
).something
'hello'
end
A::B.superclass # => C
A::B.something # => "hello"
RUBY_VERSION # => "3.0.2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment