Sha256: 639b0cb29d9c19ea699e8c6d579d7d3ab0e82b15627cedc895d344265dc7d848

Contents?: true

Size: 1.07 KB

Versions: 14

Compression:

Stored size: 1.07 KB

Contents

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

      # Test if method is public
      #
      # @return [Boolean]
      #
      # @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 expression
        Expression.parse("#{context.identification}#{self.class::SYMBOL}#{name}")
      end
      memoize :expression

      # Return match expressions
      #
      # @return [Array<Expression>]
      #
      # @api private
      #
      def match_expressions
        [expression].concat(context.match_expressions)
      end
      memoize :match_expressions

    private

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

    end # Method
  end # Subject
end # Mutant

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
mutant-0.8.0 lib/mutant/subject/method.rb
mutant-0.7.9 lib/mutant/subject/method.rb
mutant-0.7.8 lib/mutant/subject/method.rb
mutant-0.7.7 lib/mutant/subject/method.rb
mutant-0.7.6 lib/mutant/subject/method.rb
mutant-0.7.5 lib/mutant/subject/method.rb
mutant-0.7.4 lib/mutant/subject/method.rb
mutant-0.7.3 lib/mutant/subject/method.rb
mutant-0.7.2 lib/mutant/subject/method.rb
mutant-0.7.1 lib/mutant/subject/method.rb
mutant-0.6.7 lib/mutant/subject/method.rb
mutant-0.6.6 lib/mutant/subject/method.rb
mutant-0.6.5 lib/mutant/subject/method.rb
mutant-0.6.4 lib/mutant/subject/method.rb