Module: MustBe::MustOnlyEverContain::Base::ClassMethods

Defined in:
lib/must_be/containers.rb

Instance Method Summary collapse

Instance Method Details

#must_check_contents_after(*methods) ⇒ Object



153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'lib/must_be/containers.rb', line 153

def must_check_contents_after(*methods)
  methods.each do |method|
    module_eval(<<-END, __FILE__, __LINE__ + 1)
      def #{method}(*args)
        begin
          super
        ensure
          must_check_contents
        end
      end
    END
  end
end