lib/dry/initializer/config.rb in dry-initializer-2.1.0 vs lib/dry/initializer/config.rb in dry-initializer-2.2.0

- old
+ new

@@ -109,9 +109,21 @@ mixin.class_eval(code) children.each(&:finalize) self end + # Human-readable representation of configured params and options + # @return [String] + def inch + line = Builders::Signature[self] + line = line.gsub("__dry_initializer_options__", "options") + lines = ["@!method initialize(#{line})"] + lines += ["Initializes an instance of #{extended_class}"] + lines += definitions.values.map(&:inch) + lines += ["@return [#{extended_class}]"] + lines.join("\n") + end + private def initialize(extended_class = nil, null: UNDEFINED) @extended_class = extended_class.tap { |klass| klass&.include mixin } sklass = extended_class&.superclass