I’m working with a Ruby Gem that access a public API via a configurable URL. I want to have a default value built into the gem, but the ability to override that as a configuration or runtime option inside a Rails 3 app that uses the gem. What’s the best way to do that?
Share
You can expose the configuration value as a class-level property. For example, if you were developing MyConfigurableGem, you could have
And if your user was working with a rails app, you could suggest there be a file app/config/configurable_gem_override.rb with the following
Does that answer your question?