Class: MethodCallLogger
- Inherits:
-
Object
- Object
- MethodCallLogger
- Defined in:
- lib/method_call_recorder/method_call_logger.rb
Instance Attribute Summary collapse
-
#method_log ⇒ Object
readonly
Returns the value of attribute method_log.
-
#recorders ⇒ Object
readonly
Returns the value of attribute recorders.
Instance Method Summary collapse
-
#initialize ⇒ MethodCallLogger
constructor
A new instance of MethodCallLogger.
- #register(*rec_objects) ⇒ Object
Constructor Details
#initialize ⇒ MethodCallLogger
Returns a new instance of MethodCallLogger.
3 4 5 6 |
# File 'lib/method_call_recorder/method_call_logger.rb', line 3 def initialize @recorders = [] @method_log = [] end |
Instance Attribute Details
#method_log ⇒ Object (readonly)
Returns the value of attribute method_log.
15 16 17 |
# File 'lib/method_call_recorder/method_call_logger.rb', line 15 def method_log @method_log end |
#recorders ⇒ Object (readonly)
Returns the value of attribute recorders.
15 16 17 |
# File 'lib/method_call_recorder/method_call_logger.rb', line 15 def recorders @recorders end |
Instance Method Details
#register(*rec_objects) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/method_call_recorder/method_call_logger.rb', line 8 def register(*rec_objects) rec_objects.each do |rec| rec._on_method_call{|r| method_log << [r, r._last_method] } recorders << rec end end |