Class: Core::Abilities::Base::Recorder
- Inherits:
-
Object
- Object
- Core::Abilities::Base::Recorder
- Defined in:
- app/api/core/abilities.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize ⇒ Recorder
constructor
A new instance of Recorder.
- #play_back(target) ⇒ Object
- #record(&block) ⇒ Object
Constructor Details
#initialize ⇒ Recorder
Returns a new instance of Recorder.
53 54 55 |
# File 'app/api/core/abilities.rb', line 53 def initialize @recorded = [] end |
Instance Method Details
#play_back(target) ⇒ Object
57 58 59 |
# File 'app/api/core/abilities.rb', line 57 def play_back(target) @recorded.each { |block| target.instance_eval(&block) } end |
#record(&block) ⇒ Object
61 62 63 |
# File 'app/api/core/abilities.rb', line 61 def record(&block) @recorded << block end |