how to make an object disappear when viewed through another object

As the title say, I want to make an object disappear when viewed from inside another object, I want to know how can I make like a magnifying glass that makes certain objects disappear when you look through it (using blueprints or something)

I think this or this videos will help you