Sha256: dd02058462833dce13cc972a0e3d96653745e33f49c9d965962ef8ecb7bd152c

Contents?: true

Size: 456 Bytes

Versions: 2

Compression:

Stored size: 456 Bytes

Contents

# frozen_string_literal: true

require "dry/system/provider/source"

module Hanami
  module Providers
    class Settings < Dry::System::Provider::Source
      def self.for_slice(slice)
        Class.new(self) do |klass|
          klass.instance_variable_set(:@slice, slice)
        end
      end

      def self.slice
        @slice || Hanami.app
      end

      def start
        register :settings, self.class.slice.settings
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hanami-2.0.0.beta1.1 lib/hanami/providers/settings.rb
hanami-2.0.0.beta1 lib/hanami/providers/settings.rb