Sha256: a2fb974fd0ef54a2cc8f8e35a3fc83010f9bcb5debca10e5e9d5a7fd4e3c2655

Contents?: true

Size: 699 Bytes

Versions: 13

Compression:

Stored size: 699 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

13 entries across 13 versions & 1 rubygems

Version Path
mutant-0.7.1 lib/mutant/subject/method/singleton.rb
mutant-0.6.7 lib/mutant/subject/method/singleton.rb
mutant-0.6.6 lib/mutant/subject/method/singleton.rb
mutant-0.6.5 lib/mutant/subject/method/singleton.rb
mutant-0.6.4 lib/mutant/subject/method/singleton.rb
mutant-0.6.3 lib/mutant/subject/method/singleton.rb
mutant-0.6.2 lib/mutant/subject/method/singleton.rb
mutant-0.6.0 lib/mutant/subject/method/singleton.rb
mutant-0.5.26 lib/mutant/subject/method/singleton.rb
mutant-0.5.25 lib/mutant/subject/method/singleton.rb
mutant-0.5.24 lib/mutant/subject/method/singleton.rb
mutant-0.5.23 lib/mutant/subject/method/singleton.rb
mutant-0.5.22 lib/mutant/subject/method/singleton.rb