Sha256: ccd7b216b4b41c7d6d43dba3327ea198b8414843e54ae3d7cf48614e8e00033b

Contents?: true

Size: 880 Bytes

Versions: 21

Compression:

Stored size: 880 Bytes

Contents

module RR
  module Injections
    class Injection
      extend(Module.new do
        def instances
          @instances ||= HashWithObjectIdKey.new
        end
      end)

      include Space::Reader
      include ClassInstanceMethodDefined

      def subject_has_method_defined?(method_name_in_question)
        class_instance_method_defined(subject_class, method_name_in_question)
      end

      def subject_has_original_method?
        subject_has_method_defined?(original_method_alias_name)
      end

      def original_method
        subject_class.instance_method(original_method_alias_name)
      end

      protected
      def subject_respond_to_method?(subject, method_name)
        subject_has_method_defined?(method_name) ||
          class_instance_method_defined(subject_class, :respond_to?) &&
          subject.respond_to?(method_name)
      end
    end
  end
end

Version data entries

21 entries across 17 versions & 5 rubygems

Version Path
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/injections/injection.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/injections/injection.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/injections/injection.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/injections/injection.rb
bitclust-core-0.5.2 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/injections/injection.rb
bitclust-core-0.5.2 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/injections/injection.rb
bitclust-core-0.5.1 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/injections/injection.rb
mcmire-rr-1.0.5.rc1 lib/rr/injections/injection.rb
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/rr-1.0.2/lib/rr/injections/injection.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/rr-1.0.2/lib/rr/injections/injection.rb
rr-1.0.4 lib/rr/injections/injection.rb
rr-1.0.3 lib/rr/injections/injection.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/injection.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/injection.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/injection.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/injection.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/injection.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/injection.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/injections/injection.rb
rr-1.0.2 lib/rr/injections/injection.rb