lib/evil/client/schema.rb in evil-client-1.1.0 vs lib/evil/client/schema.rb in evil-client-2.0.0
- old
+ new
@@ -53,13 +53,11 @@
# The settings class inherited from the [#parent]'s one
#
# @return [Class]
#
def settings
- @settings ||= Class.new(parent&.settings || Settings).tap do |klass|
- klass.send(:instance_variable_set, :@schema, self)
- end
+ @settings ||= (parent&.settings || Settings).for(self)
end
# Adds an option to the [#settings] class
#
# @param (see Evil::Client::Settings.option)
@@ -84,11 +82,11 @@
# Adds validator to the [#settings] class
#
# @param (see Evil::Client::Settings.validate)
# @return [self]
#
- def validate(key, &block)
- settings.validate(key, &block)
+ def validate(&block)
+ settings.validate(&block)
self
end
private