-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Would we want this?
module Notifier
interface!
# ...
end
class SlackNotifier
implements Notifier # ✨
# ...
endThe implementation would literally just be Module.alias_method(:implements, :include)
Pros:
- Reads really nicely, feels native
- Tools can instantly know that
Notifieris an interface, without needing to resolve it first (it likely lives in another file)
Cons:
- Would need special support in Rubydex/RubyLSP. It wouldn't be understood by other tools by default.
- Most tools that handle Ruby understand module inclusion, so they'd know the interface's methods become available on the class. They wouldn't know that about this
implementskeyword without having bespoke support built for it.
- Most tools that handle Ruby understand module inclusion, so they'd know the interface's methods become available on the class. They wouldn't know that about this
Originally posted by @amomchilov in #2 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels