Sha256: c93e9f6cd0d69d8fc2a9fe31bb81df80365d75d31b6b436b3f997956b86e0d4f

Contents?: true

Size: 436 Bytes

Versions: 1

Compression:

Stored size: 436 Bytes

Contents

require "behavioral/version"

module Behavioral
  def with_behaviors(*mods)
    mods.each do |mod|
      mod.instance_methods.each do |meth|
        self.define_singleton_method(meth, mod.instance_method(meth))
      end
    end
    self
  end
  
  def without_behaviors(*mods)
    mods.each do |mod|
      mod.instance_methods.each do |meth|
        self.singleton_class.send(:remove_method, meth)
      end
    end
    self
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
behavioral-0.0.1 lib/behavioral.rb