Put class into interpolation block
%{Here is #{class InstantClass def bar "some text" end end InstantClass.new.bar }.}