Skip to content

Instantly share code, notes, and snippets.

@HarlemSquirrel
Created August 15, 2022 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HarlemSquirrel/acd5b3fba3cbec6c85500608fa8ab7a0 to your computer and use it in GitHub Desktop.
Save HarlemSquirrel/acd5b3fba3cbec6c85500608fa8ab7a0 to your computer and use it in GitHub Desktop.
Sharing constants between classes in same namespace
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