Sha256: 55c689c92441d5e973c7cce5a5c7b07bccfef0bfc79d7711d6a679418cdaab84

Contents?: true

Size: 745 Bytes

Versions: 3

Compression:

Stored size: 745 Bytes

Contents

# frozen_string_literal: true

require_relative 'code_context'

module Reek
  module Context
    #
    # A context wrapper for attribute definitions found in a syntax tree.
    #
    # :reek:Attribute
    class AttributeContext < CodeContext
      attr_accessor :visibility

      def initialize(context, exp, send_expression)
        @visibility = :public
        @send_expression = send_expression
        super context, exp
      end

      def full_comment
        send_expression.full_comment || ''
      end

      def instance_method?
        true
      end

      def apply_current_visibility(current_visibility)
        self.visibility = current_visibility
      end

      private

      attr_reader :send_expression
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reek-4.7.1 lib/reek/context/attribute_context.rb
reek-4.7.0 lib/reek/context/attribute_context.rb
reek-4.6.2 lib/reek/context/attribute_context.rb