Sha256: 9ad940edd89818b2abb6040692bdaf39f2b342f7716159bf10d24333bd9193ca

Contents?: true

Size: 345 Bytes

Versions: 2

Compression:

Stored size: 345 Bytes

Contents

module Figaro
  class Env < Hash
    def self.from(hash)
      new.replace(hash)
    end

    def method_missing(method, *)
      pair = ENV.detect { |k, _| k.upcase == method.to_s.upcase }
      pair ? pair[1] : super
    end

    def respond_to?(method, *)
      ENV.keys.any? { |k| k.upcase == method.to_s.upcase } || super
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
figaro-0.7.0 lib/figaro/env.rb
figaro-0.6.4 lib/figaro/env.rb