Class: Module

Inherits:
Object show all
Defined in:
lib/flexmock/deprecated_methods.rb

Instance Method Summary collapse

Instance Method Details

#flexmock_deprecate(*method_names) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/flexmock/deprecated_methods.rb', line 14

def flexmock_deprecate(*method_names)
  method_names.each do |method_name|
    eval_line = __LINE__ + 1
    module_eval %{
      def #{method_name}(*args)
        $stderr.puts "#{method_name} is deprecated, use flex#{method_name} instead"
        flex#{method_name}(*args)
      end
    }, __FILE__, eval_line
  end
end