55# with associated units of measurement.
66module RubyUnits
77 class << self
8- # @api private
9- # :reek:Attribute
10- attr_writer :configuration
11-
128 # Get or initialize the configuration
139 # @return [Configuration] the configuration instance
1410 def configuration
@@ -32,7 +28,44 @@ def self.configure
3228 yield configuration
3329 end
3430
35- # Holds actual configuration values for RubyUnits
31+ # Configuration class for RubyUnits
32+ #
33+ # This class manages global configuration settings that control how units are
34+ # formatted and represented throughout the RubyUnits library. It provides a
35+ # centralized way to customize output behavior without modifying individual
36+ # Unit instances.
37+ #
38+ # == Configuration Options
39+ #
40+ # [separator]
41+ # Controls the spacing between numeric values and unit strings in output.
42+ # - `:space` (default): Adds a single space (e.g., "5 m")
43+ # - `:none`: No space is added (e.g., "5m")
44+ #
45+ # [format]
46+ # Determines the notation style for unit representation.
47+ # - `:rational` (default): Uses numerator/denominator notation (e.g., "3 m/s^2")
48+ # - `:exponential`: Uses exponential notation (e.g., "3 m*s^-2")
49+ #
50+ # [default_precision]
51+ # Sets the precision level when converting fractional unit values to rationals.
52+ # Default is 0.0001. Must be a positive number.
53+ #
54+ # == Usage
55+ #
56+ # # Access global configuration
57+ # config = RubyUnits.configuration
58+ #
59+ # # Configure via block
60+ # RubyUnits.configure do |config|
61+ # config.separator = :none
62+ # config.format = :exponential
63+ # config.default_precision = 0.0001
64+ # end
65+ #
66+ # # Reset to defaults
67+ # RubyUnits.reset
68+ #
3669 class Configuration
3770 # Used to separate the scalar from the unit when generating output. A value
3871 # of `:space` will insert a single space, and `:none` will prevent adding a
0 commit comments