Last active
June 20, 2022 00:28
-
-
Save mcsee/2e4c88a516078500ce833dbfbd3d9b0e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Storing magnitudes without units is another smell | |
class PhysicsConstants | |
LIGHT_SPEED = 299792458.freeze | |
end | |
def energy(mass) | |
mass * PhysicsConstants::LIGHT_SPEED ** 2 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment