module DittoCode::Exec

Public Class Methods

if(environment) { || ... } click to toggle source

Exec the block of code if its environment coincide with the global environment

# File lib/dittocode/exec.rb, line 9
def self.if (environment)

        # check the env code
        unless @initialize
                DittoCode::Environments.check_env
        end

        if DittoCode::Environments.isIncluded? environment
                yield
        end 
end
is(environment) click to toggle source

Return true if the environment defined in the line coincide with the global environment. This function is used in conditional lines

# File lib/dittocode/exec.rb, line 24
def self.is (environment)

        # check the env code
        unless @initialize
                DittoCode::Environments.check_env
        end

        if DittoCode::Environments.isIncluded? environment
                true
        else
                false
        end 

end