Class: Nenv::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/nenv/environment.rb,
lib/nenv/environment/dumper.rb,
lib/nenv/environment/loader.rb

Direct Known Subclasses

AutoEnvironment

Defined Under Namespace

Classes: AlreadyExistsError, Dumper, Error, Loader, MethodError

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(namespace = nil) ⇒ Environment

Returns a new instance of Environment.


21
22
23
# File 'lib/nenv/environment.rb', line 21

def initialize(namespace = nil)
  @namespace = (namespace ? namespace.upcase : nil)
end

Class Method Details

.create_method(meth, &block) ⇒ Object


25
26
27
# File 'lib/nenv/environment.rb', line 25

def self.create_method(meth, &block)
  _create_env_method(self, meth, &block)
end

Instance Method Details

#create_method(meth, &block) ⇒ Object


29
30
31
# File 'lib/nenv/environment.rb', line 29

def create_method(meth, &block)
  self.class._create_env_method(class << self; self; end, meth, &block)
end