Class: UnitMeasurements::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/unit_measurements/configuration.rb

Overview

Note:

This class is responsible for configuring globally configurable options of unit_measurements.

The UnitMeasurements::Configuration class maintains and manages the globally configurable options of unit_measurements.

Author:

Since:

  • 5.3.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Initializes a new Configuration instance with default values of configurable options.

Author:

Since:

  • 5.3.0



35
36
37
# File 'lib/unit_measurements/configuration.rb', line 35

def initialize
  self.use_cache = false
end

Instance Attribute Details

#use_cacheTrueClass|FalseClass

Note:

This option controls whether caching is enabled for converting measurements. Defaults to false.

Get the current value of the use_cache option.

Returns:

  • (TrueClass|FalseClass)

    Returns true if caching is enabled, otherwise false.

See Also:

Author:

Since:

  • 5.3.0



28
29
30
# File 'lib/unit_measurements/configuration.rb', line 28

def use_cache
  @use_cache
end