Sha256: fb522cf2b5e5857e0a332b177fe632db8ce7408ddaa51b286a9324241d1d277d

Contents?: true

Size: 593 Bytes

Versions: 36

Compression:

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

36 entries across 34 versions & 2 rubygems

Version Path
reek-6.4.0 lib/reek/context/root_context.rb
reek-6.3.0 lib/reek/context/root_context.rb
reek-6.2.0 lib/reek/context/root_context.rb
reek-6.1.4 lib/reek/context/root_context.rb
reek-6.1.3 lib/reek/context/root_context.rb
reek-6.1.2 lib/reek/context/root_context.rb
reek-6.1.1 lib/reek/context/root_context.rb
reek-6.1.0 lib/reek/context/root_context.rb
reek-6.0.6 lib/reek/context/root_context.rb
reek-6.0.5 lib/reek/context/root_context.rb
reek-6.0.4 lib/reek/context/root_context.rb
reek-6.0.3 lib/reek/context/root_context.rb
reek-6.0.2 lib/reek/context/root_context.rb
reek-6.0.1 lib/reek/context/root_context.rb
reek-6.0.0 lib/reek/context/root_context.rb
reek-5.6.0 lib/reek/context/root_context.rb
reek-5.5.0 lib/reek/context/root_context.rb
reek-5.4.1 lib/reek/context/root_context.rb
reek-5.4.0 lib/reek/context/root_context.rb
reek-5.3.2 lib/reek/context/root_context.rb