Class: Lookout::Stub::Methods
Direct Known Subclasses
Instance Method Summary collapse
- #define(object, method, &body) ⇒ Object
-
#initialize ⇒ Methods
constructor
A new instance of Methods.
- #undefine ⇒ Object
Constructor Details
#initialize ⇒ Methods
Returns a new instance of Methods.
4 5 6 |
# File 'lib/lookout/stub/methods.rb', line 4 def initialize @methods = [] end |
Instance Method Details
#define(object, method, &body) ⇒ Object
8 9 10 |
# File 'lib/lookout/stub/methods.rb', line 8 def define(object, method, &body) Lookout::Stub::Method.new(object, method, &body).define.tap{ |m| @methods << m } end |
#undefine ⇒ Object
12 13 14 15 16 17 |
# File 'lib/lookout/stub/methods.rb', line 12 def undefine @methods.each do |method| method.undefine end self end |