Sha256: c160262fef34018090dea25c0cc11d6b62a0f52873b3b9625fe56a7cb2be7ba6
Contents?: true
Size: 638 Bytes
Versions: 17
Compression:
Stored size: 638 Bytes
Contents
# frozen_string_literal: true class Rage::Env STANDARD_ENVS = %w(development test staging production) def initialize(env) @env = env STANDARD_ENVS.each do |standard_env| self.class.define_method("#{standard_env}?") { false } if standard_env != @env end self.class.define_method("#{@env}?") { true } end def method_missing(method_name, *, &) method_name.end_with?("?") ? false : super end def respond_to_missing?(method_name, include_private = false) method_name.end_with?("?") end def ==(other) @env == other end def to_sym @env.to_sym end def to_s @env end end
Version data entries
17 entries across 17 versions & 1 rubygems