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

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

Instance Method Summary collapse

Instance Method Details

#recorder_helper(name) ⇒ Object


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

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