I was reading over some code and saw a method being defined in the following way (Ruby):
class BaseQuery
def |(other)
ChainedQuery.new do |relation|
other.call(call(relation))
end
end
end
I've tried searching ruby docs, as well as SO, but can't find examples of "|" being used at the beginning of a method definition. Can someone please explain the purpose of beginning a method definition with "|" and the effect that it has on that method ?
Thank you so much, any insight would be much appreciated.