Sha256: 841ed0f20f732f376515197a4d2ac234153e5051598e6400a58d8d8b83dc45fd

Contents?: true

Size: 653 Bytes

Versions: 28

Compression:

Stored size: 653 Bytes

Contents

# frozen_string_literal: true
require_relative 'code_context'
require_relative 'method_context'

module Reek
  module Context
    #
    # A context wrapper representing the root of an abstract syntax tree.
    #
    class RootContext < CodeContext
      def initialize(exp)
        super(nil, exp)
      end

      def type
        :root
      end

      def full_name
        ''
      end

      # Return the correct class for child method contexts (representing nodes
      # of type `:def`). For RootContext, this is the class that represents
      # instance methods.
      def method_context_class
        MethodContext
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
reek-4.6.1 lib/reek/context/root_context.rb
reek-4.6.0 lib/reek/context/root_context.rb
reek-4.5.6 lib/reek/context/root_context.rb
reek-4.5.5 lib/reek/context/root_context.rb
reek-4.5.4 lib/reek/context/root_context.rb
reek-4.5.3 lib/reek/context/root_context.rb
reek-4.5.2 lib/reek/context/root_context.rb
reek-4.5.1 lib/reek/context/root_context.rb
reek-4.5.0 lib/reek/context/root_context.rb
reek-4.4.2 lib/reek/context/root_context.rb
reek-4.4.1 lib/reek/context/root_context.rb
reek-4.4.0 lib/reek/context/root_context.rb
reek-4.3.0 lib/reek/context/root_context.rb
reek-4.2.5 lib/reek/context/root_context.rb
reek-4.2.4 lib/reek/context/root_context.rb
reek-4.2.3 lib/reek/context/root_context.rb
reek-4.2.2 lib/reek/context/root_context.rb
reek-4.2.1 lib/reek/context/root_context.rb
reek-4.2.0 lib/reek/context/root_context.rb
reek-4.1.1 lib/reek/context/root_context.rb