Duck Typing in Ruby
The problem
Imagine you are writing code that sends notifications.
At first, everything looks simple.
class EmailNotification
def send
"Sending email"
end
end
def notify(notification)
notification.send
end
Life is good.
Then one day, Slac...
adityatiwarii25.hashnode.dev2 min read