Sha256: ff35e71e9d27b30b6ef1b518b7e463817faf70171a0bd1c11cb5df326a981827

Contents?: true

Size: 703 Bytes

Versions: 9

Compression:

Stored size: 703 Bytes

Contents

module Mutant
  class Subject
    class Method
      # Singleton method subjects
      class Singleton < self

        NAME_INDEX = 1
        SYMBOL = '.'.freeze

        # Test if method is public
        #
        # @return [Boolean]
        #
        # @api private
        #
        def public?
          scope.singleton_class.public_method_defined?(name)
        end
        memoize :public?

        # Prepare subject for mutation insertion
        #
        # @return [self]
        #
        # @api private
        #
        def prepare
          scope.singleton_class.__send__(:undef_method, name)
          self
        end

      end # Singleton
    end # Method
  end # Subject
end # Mutant

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mutant-0.8.0 lib/mutant/subject/method/singleton.rb
mutant-0.7.9 lib/mutant/subject/method/singleton.rb
mutant-0.7.8 lib/mutant/subject/method/singleton.rb
mutant-0.7.7 lib/mutant/subject/method/singleton.rb
mutant-0.7.6 lib/mutant/subject/method/singleton.rb
mutant-0.7.5 lib/mutant/subject/method/singleton.rb
mutant-0.7.4 lib/mutant/subject/method/singleton.rb
mutant-0.7.3 lib/mutant/subject/method/singleton.rb
mutant-0.7.2 lib/mutant/subject/method/singleton.rb