Sha256: 1343b5fc68d9cff88235e15b4dd709293c065f8726d5db63b2a899a4d4c2f2df

Contents?: true

Size: 341 Bytes

Versions: 5

Compression:

Stored size: 341 Bytes

Contents

# encoding: utf-8

module AddMethodMissing
  def add_method_missing(name = :described_class)
    before do
      # when #optimize delegates to super, it would normally
      # explode, so define method_missing to return self
      send(name).class_eval do
        def method_missing(*)
          self
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
axiom-optimizer-0.1.0 spec/support/add_method_missing.rb
veritas-optimizer-0.0.7 spec/support/add_method_missing.rb
veritas-optimizer-0.0.6 spec/support/add_method_missing.rb
veritas-optimizer-0.0.5 spec/support/add_method_missing.rb
veritas-optimizer-0.0.4 spec/support/add_method_missing.rb