lib/docrb/lib/docrb/ruby_parser.rb
# Changes the visibility of a single object on a given parent to a provided
# value.
#
# of: - Name of the object having its visibility changed.
# to: - New visibility value for the object.
# on: - The object's parent container.
Changes the visibility of a single object on a given parent to a provided
value.

- Name of the object having its visibility changed.
to: - New visibility value for the object.
on: - The object's parent container.
Changes the visibility of a single object on a given parent to a provided value . - Name of the object having its visibility changed . to : - New visibility value for the object . on : - The object ' s parent container .
def change_visibility(of:, to:, on:)
      if on.key?(:methods) && (method = on[:methods].find { |m| m[:name] == of })
        return method[:visibility] = to
      end
      writer = of.end_with? "="
      normalized = of.to_s.gsub(/=$/, "").to_sym
      if on.key?(:attr_accessor) && (acc = on[:attr_accessor].find { |a| a[:name] == normalized })
        return acc[writer ? :writer_visibility : :reader_visibility] = to
      end
      type = writer ? :attr_writer : :attr_reader
      return unless on.key?(type) && (acc = on[type].find { |a| a[:name] == normalized })
      acc[writer ? :writer_visibility : :reader_visibility] = to
    end
def change_visibility ( of : , to : , on : ) if on . key? ( :methods ) && ( method = on [ :methods ] . find { | m | m [ :name ] == of } ) return method [ :visibility ] = to end writer = of . end_with? "=" normalized = of . to_s . gsub ( / =$ / , "" ) . to_sym if on . key? ( :attr_accessor ) && ( acc = on [ :attr_accessor ] . find { | a | a [ :name ] == normalized } ) return acc [ writer ? :writer_visibility : :reader_visibility ] = to end type = writer ? :attr_writer : :attr_reader return unless on . key? ( type ) && ( acc = on [ type ] . find { | a | a [ :name ] == normalized } ) acc [ writer ? :writer_visibility : :reader_visibility ] = to end
Changes the visibility of a single object on a given parent to a provided
value.
Changes the visibility of a single object on a given parent to a provided value .
# Method? # Accessor? # Reader or writer?
of
to
on