Sha256: dfffc91ef1ef639ccbf2f8e1376b373e17d169b3be5582182b13be71195008eb

Contents?: true

Size: 1.1 KB

Versions: 83

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

require 'avm/entries/keys_constants_set'
require 'avm/entries/uri_builder'
require 'eac_ruby_utils/core_ext'

module Avm
  module Instances
    module EntryKeys
      URI_FIELDS = ::Avm::Entries::UriBuilder::ENTRIES_FIELDS + %w[url]

      class << self
        def all
          all_keys.to_a
        end

        def keys_consts_set(prefix, suffixes)
          all_keys.merge(::Avm::Entries::KeysConstantsSet.new(self, prefix, suffixes).result)
        end

        private

        def all_keys
          @all_keys ||= ::Set.new
        end
      end

      {
        '' => %w[name source_instance_id],
        admin: URI_FIELDS + %w[api_key],
        database: URI_FIELDS + %w[id limit name system timeout extra],
        docker: %w[registry],
        install: URI_FIELDS + %w[id data_path email groupname],
        mailer: {
          '' => %w[id from reply_to],
          smtp: URI_FIELDS + %w[address domain authentication openssl_verify_mode starttls_auto tls]
        },
        web: URI_FIELDS
      }.each { |prefix, suffixes| keys_consts_set(prefix, suffixes) }
    end
  end
end

Version data entries

83 entries across 83 versions & 2 rubygems

Version Path
eac_tools-0.33.0 sub/avm/lib/avm/instances/entry_keys.rb
avm-0.45.0 lib/avm/instances/entry_keys.rb
eac_tools-0.32.0 sub/avm/lib/avm/instances/entry_keys.rb