Class: Ukiryu::Config::EnvSchema

Inherits:
Object
  • Object
show all
Defined in:
lib/ukiryu/config/env_schema.rb

Overview

Schema definition for configuration attributes Defines attribute types and ENV variable mappings

Constant Summary collapse

ATTRIBUTE_TYPES =
{
  # Execution options
  timeout: :integer,
  debug: :boolean,
  dry_run: :boolean,
  metrics: :boolean,
  shell: :symbol,

  # Output options
  format: :symbol,
  output: :string,

  # Register options
  register: :string,

  # Color options
  use_color: :boolean
}.freeze

Class Method Summary collapse

Class Method Details

.all_attributesObject

All attributes



54
55
56
# File 'lib/ukiryu/config/env_schema.rb', line 54

def all_attributes
  %i[timeout debug dry_run metrics shell format output register use_color]
end

.all_execution_attributesObject

All execution attributes



39
40
41
# File 'lib/ukiryu/config/env_schema.rb', line 39

def all_execution_attributes
  %i[timeout debug dry_run metrics shell]
end

.all_output_attributesObject

All output attributes



44
45
46
# File 'lib/ukiryu/config/env_schema.rb', line 44

def all_output_attributes
  %i[format output use_color]
end

.all_register_attributesObject

All register attributes



49
50
51
# File 'lib/ukiryu/config/env_schema.rb', line 49

def all_register_attributes
  %i[register]
end

.env_key(attribute) ⇒ Object

Generate ENV key for a config attribute e.g., env_key(:timeout) => “UKIRYU_TIMEOUT”



34
35
36
# File 'lib/ukiryu/config/env_schema.rb', line 34

def env_key(attribute)
  "UKIRYU_#{attribute.to_s.upcase}"
end

.type_for(attribute) ⇒ Object



28
29
30
# File 'lib/ukiryu/config/env_schema.rb', line 28

def type_for(attribute)
  ATTRIBUTE_TYPES[attribute.to_sym]
end