Class: UffizziCore::ComposeFile::Parsers::Services::ConfigsParserService

Inherits:
Object
  • Object
show all
Defined in:
app/services/uffizzi_core/compose_file/parsers/services/configs_parser_service.rb

Class Method Summary collapse

Class Method Details

.parse(configs, global_configs_data) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/services/uffizzi_core/compose_file/parsers/services/configs_parser_service.rb', line 5

def parse(configs, global_configs_data)
  return [] if configs.nil?

  configs.map do |config|
    config_data = case config
                  when String
                    process_short_syntax(config, global_configs_data)
                  when Hash
                    process_long_syntax(config, global_configs_data)
                  else
                    raise UffizziCore::ComposeFile::ParseError, I18n.t('compose.invalid_type', option: :configs)
    end

    config_data
  end
end