lib/attestor/validations/validators.rb in attestor-0.4.0 vs lib/attestor/validations/validators.rb in attestor-1.0.0

- old
+ new

@@ -40,11 +40,11 @@ # @param [#to_sym] context # # @return [Attestor::Validators] def set(context) validators = select { |item| item.used_in_context? context } - + self.class.new(validators) end # Returns validators updated by a new validator with given args # @@ -62,23 +62,15 @@ # @return [Attestor::Validators] def add_delegator(*args, &block) add_item Delegator, *args, &block end - # @deprecated - def add_follower(*args) - warn "[DEPRECATED] .add_follower is deprecated since v1.0.0" \ - " Use .validates method instead." - add_item Follower, *args - end - private attr_reader :items def add_item(type, *args, &block) - item = type.new(*args, &block) - include?(item) ? self : self.class.new(items, item) + self.class.new items, type.new(*args, &block) end end # class Validators end # module Validations