Module: Compound::Guard

Extended by:
BaseGuardMethods
Defined in:
lib/compound/guard.rb

Class Method Summary collapse

Methods included from BaseGuardMethods

included, warn_about

Class Method Details

.guard(mod) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



23
24
25
26
27
28
29
30
# File 'lib/compound/guard.rb', line 23

def self.guard mod
  mod.define_singleton_method :extended do |obj|
    ::Compound::Guard.warn_about self unless obj.is_a? ::Compound::Part
  end
  mod.define_singleton_method :included do |_|
    ::Compound::Guard.warn_about self
  end
end