Class: EnvHelper

Inherits:
Object show all
Defined in:
lib/openc3/utilities/env_helper.rb

Overview

Copyright 2026 OpenC3, Inc. All Rights Reserved.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.md for more details.

This file may also be used under the terms of a commercial license if purchased from OpenC3, Inc.

Class Method Summary collapse

Class Method Details

.enabled?(key) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/openc3/utilities/env_helper.rb', line 15

def self.enabled?(key)
  ['true', '1', 'yes', 'on'].include?(ENV[key].to_s.downcase)
end

.set?(key) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/openc3/utilities/env_helper.rb', line 19

def self.set?(key)
  !ENV[key].to_s.empty?
end