Sha256: e580423fb446743e1a1c716232b6ca3b4add2cd868b87e00ee210ef7831e1218

Contents?: true

Size: 407 Bytes

Versions: 9

Compression:

Stored size: 407 Bytes

Contents

# frozen_string_literal: true

module Dsu
  class << self
    def env
      @env ||= Struct.new(:env) do
        def test?
          env.fetch('DSU_ENV', nil) == 'test'
        end

        def development?
          env.fetch('DSU_ENV', nil) == 'development'
        end

        def production?
          env.fetch('DSU_ENV', 'production') == 'production'
        end
      end.new(ENV)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dsu-2.0.8 lib/dsu/env.rb
dsu-2.0.7 lib/dsu/env.rb
dsu-2.0.6 lib/dsu/env.rb
dsu-2.0.5 lib/dsu/env.rb
dsu-2.0.4 lib/dsu/env.rb
dsu-2.0.3 lib/dsu/env.rb
dsu-2.0.2 lib/dsu/env.rb
dsu-2.0.1 lib/dsu/env.rb
dsu-2.0.0.alpha.1 lib/dsu/env.rb