Class: Manioc::Env

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

Constant Summary collapse

Unset =
Class.new StandardError

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/manioc/env.rb', line 5

def method_missing name, *args
  super if args.count > 1
  if name =~ /\A(.*)!\Z/
    ENV[$1] || raise(Unset, $1)
  else
    ENV[name.to_s]
  end
end