Sha256: 4b0ecf6a20f14cb4483dbf0efb1511a40c3a4dd4f0f895adc376c63aeac1802a

Contents?: true

Size: 417 Bytes

Versions: 6

Compression:

Stored size: 417 Bytes

Contents

class Shoes
  module Swt
    module DisposedProtection
      def real
        return NullObject.new(@real) if @real.disposed?
        @real
      end

      class NullObject < BasicObject
        def initialize(real)
          @real = real
        end

        def respond_to?(method)
          @real.respond_to? method
        end

        def method_missing(_method, *_args)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
shoes-swt-4.0.0.pre8 lib/shoes/swt/disposed_protection.rb
shoes-swt-4.0.0.pre7 lib/shoes/swt/disposed_protection.rb
shoes-swt-4.0.0.pre6 lib/shoes/swt/disposed_protection.rb
shoes-swt-4.0.0.pre5 lib/shoes/swt/disposed_protection.rb
shoes-swt-4.0.0.pre4 lib/shoes/swt/disposed_protection.rb
shoes-swt-4.0.0.pre3 lib/shoes/swt/disposed_protection.rb