There is an "accept" example in the documentation. But i can't figure out what is the use of the "reject" method? Can somebody explain the sense and give some usage example?
For example, using the snippet in documentation demonstrating accept:
op.accept(User) do |user_id|
find_user user_id.to_i
end
If after that we issue op.reject(User), User will no longer be accepted — as if op.accept(User) ... was never specified. If we try, the code would generate unsupported argument type: User (ArgumentError).
It simply undoes
accept.For example, using the snippet in documentation demonstrating
accept:If after that we issue
op.reject(User),Userwill no longer be accepted — as ifop.accept(User) ...was never specified. If we try, the code would generateunsupported argument type: User (ArgumentError).