module Haml module Safemode class Jail < Blankslate def initialize(source = nil) @source = source end def to_jail self end def to_s @source.to_s end def method_missing(method, *args, &block) unless self.class.allowed?(method) raise Haml::Safemode::NoMethodError.new(method, self.class.name, @source.class.name) end @source.send(method, *args, &block).to_jail end end end end