Sha256: a85ff838c7845023c1e1805927aeb74fdaa1018ce5e7c30daab66984b2b47586

Contents?: true

Size: 1.21 KB

Versions: 32

Compression:

Stored size: 1.21 KB

Contents

# encoding: utf-8

module Mutant
  class Subject
    # Abstract base class for method subjects
    class Method < self

      # Test if method is public
      #
      # @return [true]
      #   if method is public
      #
      # @return [false]
      #   otherwise
      #
      # @api private
      #
      abstract_method :public?

      # Return method name
      #
      # @return [Symbol]
      #
      # @api private
      #
      def name
        node.children[self.class::NAME_INDEX]
      end

      # Return match expression
      #
      # @return [String]
      #
      # @api private
      #
      def match_expression
        "#{context.identification}#{self.class::SYMBOL}#{name}"
      end

    private

      # Return mutations
      #
      # @param [#<<] emitter
      #
      # @return [undefined]
      #
      # @api private
      #
      def generate_mutations(emitter)
        emitter << noop_mutation
        Mutator.each(node) do |mutant|
          emitter << Mutation::Evil.new(self, mutant)
        end
      end

      # Return scope
      #
      # @return [Class, Module]
      #
      # @api private
      #
      def scope
        context.scope
      end

    end # Method
  end # Subject
end # Mutant

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
mutant-0.5.19 lib/mutant/subject/method.rb
mutant-0.5.18 lib/mutant/subject/method.rb
mutant-0.5.17 lib/mutant/subject/method.rb
mutant-0.5.16 lib/mutant/subject/method.rb
mutant-0.5.15 lib/mutant/subject/method.rb
mutant-0.5.14 lib/mutant/subject/method.rb
mutant-0.5.13 lib/mutant/subject/method.rb
mutant-0.5.12 lib/mutant/subject/method.rb
mutant-0.5.11 lib/mutant/subject/method.rb
mutant-0.5.10 lib/mutant/subject/method.rb
mutant-0.5.9 lib/mutant/subject/method.rb
mutant-0.5.8 lib/mutant/subject/method.rb
mutant-0.5.7 lib/mutant/subject/method.rb
mutant-0.5.6 lib/mutant/subject/method.rb
mutant-0.5.5 lib/mutant/subject/method.rb
mutant-0.5.4 lib/mutant/subject/method.rb
mutant-0.5.3 lib/mutant/subject/method.rb
mutant-0.5.2 lib/mutant/subject/method.rb
mutant-0.5.1 lib/mutant/subject/method.rb
mutant-0.5.0 lib/mutant/subject/method.rb