Created
May 13, 2015 14:22
-
-
Save jdanielnd/07f81dd2198df828f9ba to your computer and use it in GitHub Desktop.
This file contains hidden or 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
require 'active_support/configurable' | |
module Statistics | |
include ActiveSupport::Configurable | |
config_accessor :end_point | |
self.config.server ||= "https://statistics.appprova.com.br" | |
def self.some_method(args = {}, params = {}) | |
uri = URI.parse("#{Statistics.config.server}/api/bla/bla") | |
... | |
end | |
end | |
## Se quiser mudar o server default | |
## Initializer | |
config/initializers/statistics.rb | |
require 'statistics' | |
Statistics.configure do |config| | |
config.server = "http://someother.appprova.com.br" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍