lib/hanami/assets/app_config.rb in hanami-2.0.0.beta4 vs lib/hanami/assets/app_config.rb in hanami-2.0.0.rc1
- old
+ new
@@ -1,67 +1,59 @@
# frozen_string_literal: true
require "dry/configurable"
-require_relative "config"
module Hanami
+ # @api private
module Assets
- # @since 2.0.0
- # @api public
+ # App config for assets.
+ #
+ # This is NOT RELEASED as of 2.0.0.
+ #
+ # @api private
class AppConfig
include Dry::Configurable
- # @since 2.0.0
- # @api private
attr_reader :base_config
protected :base_config
setting :server_url, default: "http://localhost:8080"
- # @since 2.0.0
- # @api private
def initialize(*)
super
- @base_config = Config.new
+ @base_config = Assets::Config.new
end
def initialize_copy(source)
super
@base_config = source.base_config.dup
end
- # @since 2.0.0
- # @api private
def finalize!
end
# Returns the list of available settings
#
# @return [Set]
#
- # @since 2.0.0
# @api private
def settings
base_config.settings + self.class.settings
end
private
- # @since 2.0.0
- # @api private
def method_missing(name, *args, &block)
if config.respond_to?(name)
config.public_send(name, *args, &block)
elsif base_config.respond_to?(name)
base_config.public_send(name, *args, &block)
else
super
end
end
- # @since 2.0.0
- # @api private
def respond_to_missing?(name, _incude_all = false)
config.respond_to?(name) || base_config.respond_to?(name) || super
end
end
end