Created
August 15, 2022 15:38
-
-
Save HarlemSquirrel/acd5b3fba3cbec6c85500608fa8ab7a0 to your computer and use it in GitHub Desktop.
Sharing constants between classes in same namespace
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
module Youtube | |
API_KEY = Rails.application.credentials.youtube_api_key.freeze | |
end | |
module Youtube | |
class SomeClass | |
def call | |
puts API_KEY | |
end | |
end | |
end | |
module Youtube | |
class SomeOtherClass | |
def call | |
puts API_KEY | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment