codoc 0.1.0

Unified documentation parser for Ruby and TypeScript codebases
Documentation
# frozen_string_literal: true

# A class demonstrating attribute declarations.
class AttributeExamples
  # A read-only attribute.
  #
  # @return [String]
  attr_reader :readonly_value

  # A write-only attribute.
  #
  # @return [Integer]
  attr_writer :writeonly_value

  # A read-write attribute.
  #
  # @return [Boolean]
  attr_accessor :readwrite_value

  # Multiple attributes on one line (read-only).
  #
  # @return [Object]
  attr_reader :first, :second, :third

  # Multiple attributes on one line (read-write).
  #
  # @return [Object]
  attr_accessor :alpha, :beta

  # Initializes the attributes.
  #
  # @param readonly [String] the read-only value
  def initialize(readonly)
    @readonly_value = readonly
    @writeonly_value = 0
    @readwrite_value = false
    @first = @second = @third = nil
    @alpha = @beta = nil
  end
end