Sha256: f15abdf54a06fc8318a87ebbe4a42079d1621c3c73562d174a8a04f4eedaa792

Contents?: true

Size: 557 Bytes

Versions: 4

Compression:

Stored size: 557 Bytes

Contents

require_relative 'code_context'
require_relative '../ast/sexp_formatter'

module Reek
  module Context
    #
    # A context wrapper for any module found in a syntax tree.
    #
    # @api private
    class ModuleContext < CodeContext
      def initialize(outer, exp)
        super(outer, exp)
        @name = AST::SexpFormatter.format(exp.children.first)
      end

      def node_instance_methods
        local_nodes(:def)
      end

      def descriptively_commented?
        CodeComment.new(exp.leading_comment).descriptive?
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reek-3.0.3 lib/reek/context/module_context.rb
reek-3.0.2 lib/reek/context/module_context.rb
reek-3.0.1 lib/reek/context/module_context.rb
reek-3.0.0 lib/reek/context/module_context.rb