Module: Core::Abilities::Base::ClassMethods

Included in:
Core::Abilities::Base
Defined in:
app/api/core/abilities.rb

Overview

rubocop:todo Style/Documentation

Instance Method Summary collapse

Instance Method Details

#recorder_helper(name) ⇒ Object


67
68
69
70
71
72
73
74
# File 'app/api/core/abilities.rb', line 67

def recorder_helper(name)
  line = __LINE__ + 1
  singleton_class.class_eval("
    def #{name}(&block)
      record(@#{name} ||= Recorder.new, &block)
    end
  ", __FILE__, line)
end