Sha256: 47baee7f649bf0f85f7ae6696e06068b29bf8a88eb19d20905b2fc53eee82bac

Contents?: true

Size: 558 Bytes

Versions: 1

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

require "dry/core/constants"
require_relative "settings/definition"
require_relative "settings/struct"

module Hanami
  class Application
    # Application settings
    #
    # @since 2.0.0
    module Settings
      Undefined = Dry::Core::Constants::Undefined

      def self.build(loader, loader_options, &definition_block)
        definition = Definition.new(&definition_block)
        settings = loader.new(**loader_options).call(definition.settings)

        Struct[settings.keys].new(settings)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hanami-2.0.0.alpha2 lib/hanami/application/settings.rb