Sha256: 03c3768bed66daa2353148b7c58037be78812f4d69ceb4c6f0bd959777848573

Contents?: true

Size: 744 Bytes

Versions: 28

Compression:

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

28 entries across 28 versions & 1 rubygems

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