Class: Class
- Inherits:
-
Object
- Object
- Class
- Includes:
- ClassExtensions
- Defined in:
- lib/class_extensions.rb
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#stub_class_methods(*args) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/class_extensions.rb', line 7 def stub_class_methods(*args) class<<self; self; end.class_eval do args.each do |method_name| define_method method_name do |*args| end end end end |
#stub_instance_methods(*args) ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/class_extensions.rb', line 16 def stub_instance_methods(*args) class_eval do args.each do |method_name| define_method method_name do |*args| end end end end |