Sha256: f11f1ada75155daddb600c7b22b5ecbdeb26ab86137a9d03bc292bcdb5a8b0ce

Contents?: true

Size: 561 Bytes

Versions: 10

Compression:

Stored size: 561 Bytes

Contents

# frozen_string_literal: true

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

        NAME_INDEX = 1
        SYMBOL     = '.'

        # Prepare subject for mutation insertion
        #
        # @return [self]
        def prepare
          scope.raw.singleton_class.undef_method(name)
          self
        end

        def post_insert
          scope.raw.singleton_class.__send__(visibility, name)
          self
        end

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
mutant-0.12.4 lib/mutant/subject/method/singleton.rb
mutant-0.12.3 lib/mutant/subject/method/singleton.rb
mutant-0.12.2 lib/mutant/subject/method/singleton.rb
mutant-0.12.0 lib/mutant/subject/method/singleton.rb
mutant-0.11.34 lib/mutant/subject/method/singleton.rb
mutant-0.11.33 lib/mutant/subject/method/singleton.rb
mutant-0.11.32 lib/mutant/subject/method/singleton.rb
mutant-0.11.31 lib/mutant/subject/method/singleton.rb
mutant-0.11.30 lib/mutant/subject/method/singleton.rb
mutant-0.11.29 lib/mutant/subject/method/singleton.rb