Sha256: a80cbb784eaa2e45c65394cf8dd4dae4cf8a05fb0603c58ad8e651e70f48ca11

Contents?: true

Size: 444 Bytes

Versions: 15

Compression:

Stored size: 444 Bytes

Contents

module Resugan
  module ObjectHelpers
    def self.included base
      base.extend ClassMethods
    end

    module ClassMethods
      def attach_hook(method, options = {})
        alias_method "_resugan_orig_#{method}".to_sym, method.to_sym

        define_method(method.to_sym) do |*args|
          resugan options[:namespace] do
            send("_resugan_orig_#{method}".to_sym, *args)
          end
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
resugan-0.1.15 lib/resugan/object_helpers.rb
resugan-0.1.14 lib/resugan/object_helpers.rb
resugan-0.1.13 lib/resugan/object_helpers.rb
resugan-0.1.12 lib/resugan/object_helpers.rb
resugan-0.1.11 lib/resugan/object_helpers.rb
resugan-0.1.10 lib/resugan/object_helpers.rb
resugan-0.1.9 lib/resugan/object_helpers.rb
resugan-0.1.8 lib/resugan/object_helpers.rb
resugan-0.1.7 lib/resugan/object_helpers.rb
resugan-0.1.6 lib/resugan/object_helpers.rb
resugan-0.1.5 lib/resugan/object_helpers.rb
resugan-0.1.4 lib/resugan/object_helpers.rb
resugan-0.1.2 lib/resugan/object_helpers.rb
resugan-0.1.1 lib/resugan/object_helpers.rb
resugan-0.1.0 lib/resugan/object_helpers.rb