Class: Figaro::Env

Inherits:
Hash
  • Object
show all
Defined in:
lib/figaro/env.rb

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method) ⇒ Object



7
8
9
# File 'lib/figaro/env.rb', line 7

def method_missing(method, *)
  ENV.fetch(method.to_s.upcase) { super }
end

Class Method Details

.from(hash) ⇒ Object



3
4
5
# File 'lib/figaro/env.rb', line 3

def self.from(hash)
  new.replace(hash)
end

Instance Method Details

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/figaro/env.rb', line 11

def respond_to?(method)
  ENV.key?(method.to_s.upcase)
end