 <p>You can use that, im not using the prettiest way, but you can write a new accessor that injects that methods.</p> <p>Classes:</p> <pre><code>class Container def property=(arg) arg.called_from = self.class @arg = arg end def property @arg end end class SomeClass def container_class @klass end def called_from=(klass) @klass = klass end end </code></pre> <p>Spec:</p> <pre><code>require_relative 'container' describe Container do let(:container) { Container.new } it 'passes message' do container.property = SomeClass.new expect(container.property.container_class).to eq Container end end </code></pre>