Module: Lab42::CheckedClass::Mixin::ClassMethods

Defined in:
lib/lab42/checked_class/mixin/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#defchecked(mthd_name, &blk) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/lab42/checked_class/mixin/class_methods.rb', line 8

def defchecked(mthd_name, &blk)
  define_method mthd_name do |*a, **k, &b|
    instance_exec(*a, **k, &blk).tap do
      check!
    end
  end
end