Sha256: e58aa977bd96f0da166770e6bb9843897f08514fdad2f92653f221857ff01a55

Contents?: true

Size: 302 Bytes

Versions: 5

Compression:

Stored size: 302 Bytes

Contents

module EnsureIt
  if ENSURE_IT_REFINED
    def self.patch(target, &block)
      module_eval do
        refine target do
          class_eval(&block)
        end
      end
    end
  else
    def self.patch(target, &block)
      target.class_eval(&block)
    end
  end

  private_class_method :patch
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ensure_it-1.0.0 lib/ensure_it/patch.rb
ensure_it-0.1.5 lib/ensure_it/patch.rb
ensure_it-0.1.4 lib/ensure_it/patch.rb
ensure_it-0.1.3 lib/ensure_it/patch.rb
ensure_it-0.1.2 lib/ensure_it/patch.rb