Sha256: 01a256600b1b7ab4470d1e8ab1ea5a998204d30749b38e1fca0f8344a25754cf

Contents?: true

Size: 748 Bytes

Versions: 1

Compression:

Stored size: 748 Bytes

Contents

module Sandboxy

    def self.environment
        config = get_config
        if config&.key :environment
            config[:environment]
        else
            'live'
        end
    end

    def self.sandbox?
        Sandboxy.environment == 'sandbox' ? true : false
    end

    def self.live?
        !Sandboxy.sandbox?
    end

    def self.retain_environment
        config = get_config
        if config&.key :retain_environment
            config[:retain_environment]
        else
            false
        end
    end


    private


    def self.get_config
        require 'yaml'

        begin
            YAML.load_file 'config/sandboxy.yml'
        rescue Exception
        end
    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sandboxy-1.1.0 lib/sandboxy/configuration.rb