Sha256: 446814294b453d69dea3ffd0a4acb98af37388193e45b01090068c2828ece05e

Contents?: true

Size: 553 Bytes

Versions: 18

Compression:

Stored size: 553 Bytes

Contents

module Datadog
  # Namespace for handling application environment
  module Environment
    # Defines helper methods for environment
    module Helpers
      def env_to_bool(var, default = nil)
        ENV.key?(var) ? ENV[var].to_s.downcase == 'true' : default
      end

      def env_to_float(var, default = nil)
        ENV.key?(var) ? ENV[var].to_f : default
      end

      def env_to_list(var, default = [])
        if ENV.key?(var)
          ENV[var].split(',').map(&:strip)
        else
          default
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
ls-trace-0.1.2 lib/ddtrace/environment.rb
ddtrace-0.33.1 lib/ddtrace/environment.rb
ddtrace-0.33.0 lib/ddtrace/environment.rb
ddtrace-0.32.0 lib/ddtrace/environment.rb
ddtrace-0.31.1 lib/ddtrace/environment.rb
ddtrace-0.31.0 lib/ddtrace/environment.rb
ddtrace-0.30.1 lib/ddtrace/environment.rb
ddtrace-0.30.0 lib/ddtrace/environment.rb
ddtrace-0.29.1 lib/ddtrace/environment.rb
ddtrace-0.26.1 lib/ddtrace/environment.rb
ls-trace-0.1.1 lib/ddtrace/environment.rb
ddtrace-0.29.0 lib/ddtrace/environment.rb
ddtrace-0.28.0 lib/ddtrace/environment.rb
ddtrace-0.27.0 lib/ddtrace/environment.rb
ddtrace-0.26.0 lib/ddtrace/environment.rb
ddtrace-0.25.1 lib/ddtrace/environment.rb
ddtrace-0.25.0 lib/ddtrace/environment.rb
ddtrace-0.24.0 lib/ddtrace/environment.rb