Sha256: 8c5731e534a3259f0eef26ae9a6dda0857354cf46fabec6b0ac6b3ae7ceacce3
Contents?: true
Size: 610 Bytes
Versions: 12
Compression:
Stored size: 610 Bytes
Contents
class Volt class Environment def initialize @env = ENV['VOLT_ENV'] # If we're in opal, we can set the env from JS before opal loads if RUBY_PLATFORM == 'opal' unless @env `if (window.start_env) {` @env = `window.start_env` `}` end end @env ||= 'development' end def ==(val) @env == val end def production? self.==('production') end def test? self.==('test') end def development? self.==('development') end def inspect @env.inspect end end end
Version data entries
12 entries across 12 versions & 1 rubygems