Module: Envlogic

Defined in:
lib/envlogic.rb,
lib/envlogic/env.rb,
lib/envlogic/version.rb

Overview

Main module to encapsulate logic

Defined Under Namespace

Classes: Env

Constant Summary collapse

VERSION =

Current version of gem

'1.1.2'

Instance Method Summary collapse

Instance Method Details

#envEnvlogic::Env Also known as: environment

Returns envlogic env instance that allows us to check environment.

Examples:

Invoke env in TestClass

TestClass.env #=> Envlogic::Env instance

Returns:

  • (Envlogic::Env)

    envlogic env instance that allows us to check environment



35
36
37
# File 'lib/envlogic.rb', line 35

def env
  @env ||= Envlogic::Env.new(self)
end

#env=(environment) ⇒ Envlogic::Env Also known as: environment=

Returns envlogic env instance.

Examples:

Assign new environment to MyApp

MyApp.env = :production

Parameters:

  • environment (String, Symbol)

    new environment that we want to set

Returns:



43
44
45
# File 'lib/envlogic.rb', line 43

def env=(environment)
  env.update(environment.to_s)
end