Sha256: a907d2bbabd00fd6c43664f8f7512bb7009fa54f6efb3e915a1dd5fd65db8472
Contents?: true
Size: 483 Bytes
Versions: 47
Compression:
Stored size: 483 Bytes
Contents
# frozen_string_literal: true require "active_support/string_inquirer" module ActiveSupport class EnvironmentInquirer < StringInquirer # :nodoc: DEFAULT_ENVIRONMENTS = ["development", "test", "production"] def initialize(env) super(env) DEFAULT_ENVIRONMENTS.each do |default| instance_variable_set :"@#{default}", env == default end end DEFAULT_ENVIRONMENTS.each do |env| class_eval "def #{env}?; @#{env}; end" end end end
Version data entries
47 entries across 44 versions & 8 rubygems