You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we implement the case matching on our Result objects we could in theory make the following usage pattern possible:
result = FormatParser.parse(...)
case result
when :image
# render thumbnail
when :audio
# render soundbite
when :video
# extract the first N seconds and render soundbite
else
# render a generic icon and be done...
end
The text was updated successfully, but these errors were encountered:
Meh, that is not possible to do because the threequals operator cannot be inversed. In this code example the symbol would be the receiver of the ===, not the result.
If we implement the case matching on our
Result
objects we could in theory make the following usage pattern possible:The text was updated successfully, but these errors were encountered: