Class: ActiveSupport::FetchRailsEnv

Inherits:
BasicObject
Defined in:
lib/active_support/fetch_rails_env.rb

Instance Method Summary collapse

Constructor Details

#initialize(wrapped) ⇒ FetchRailsEnv

Returns a new instance of FetchRailsEnv.



7
8
9
# File 'lib/active_support/fetch_rails_env.rb', line 7

def initialize(wrapped)
  @wrapped = wrapped
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



20
21
22
# File 'lib/active_support/fetch_rails_env.rb', line 20

def method_missing(sym, *args, &block)
  config[sym]
end

Instance Method Details

#[](sym) ⇒ Object Also known as: fetch



15
16
17
# File 'lib/active_support/fetch_rails_env.rb', line 15

def [](sym)
  config[sym]
end

#configObject



11
12
13
# File 'lib/active_support/fetch_rails_env.rb', line 11

def config
  @config ||= @wrapped[::Rails.env.to_sym] || {}
end