module Connfuse::ClassMethods

Protected Instance Methods

fuse_for(*methods) click to toggle source
# File lib/connfuse.rb, line 14
def fuse_for(*methods)
  methods.each do |m|
    alias_method "#{m}_old".to_sym, m.to_sym
    define_method(m.to_sym) do |*args|
      self.class.circuit.pass_thru { send("#{m}_old".to_sym, *args) }
    end
    private "#{m}_old".to_sym
  end
end