lib/dry/behaviour/black_tie.rb in dry-behaviour-0.5.1 vs lib/dry/behaviour/black_tie.rb in dry-behaviour-0.5.2
- old
+ new
@@ -44,9 +44,13 @@
rescue ArgumentError => e
raise Dry::Protocol::NotImplemented.new(:method, inspect, "#{method} (#{e.message})")
end
end
end
+
+ singleton_class.send :define_method, :respond_to? do |method|
+ BlackTie.protocols[self].keys.include? method
+ end
end
def defmethod(name, *params)
BlackTie.protocols[self][name] = params
end