Class: Trashed::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/trashed/railtie.rb

Instance Method Summary collapse

Instance Method Details

#connect_to_statsd(options) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/trashed/railtie.rb', line 48

def connect_to_statsd(options)
  require 'statsd'

  case options
  when Statsd
    options
  when Hash
    Statsd.new(options[:host], options[:port]).tap do |statsd|
      statsd.namespace = options[:namespace]
    end
  end
end