Module: StatsWhisper::Environment
Instance Method Summary collapse
Instance Method Details
#backend ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/stats_whisper/environment.rb', line 12 def backend case environment when 'production', 'staging', 'test' Backend::StatsD.new else Backend::Logger.new end end |
#environment ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/stats_whisper/environment.rb', line 21 def environment if defined?(Rails) Rails.env else ENV['RAILS_ENV'] || 'development' end end |